+6
-1
appview/middleware/middleware.go
+6
-1
appview/middleware/middleware.go
···
317
318
// this should serve the go-import meta tag even if the path is technically
319
// a 404 like tangled.sh/oppi.li/go-git/v5
320
func (mw Middleware) GoImport() middlewareFunc {
321
return func(next http.Handler) http.Handler {
322
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
···
332
if r.Header.Get("User-Agent") == "Go-http-client/1.1" {
333
if r.URL.Query().Get("go-get") == "1" {
334
html := fmt.Sprintf(
335
-
`<meta name="go-import" content="tangled.sh/%s git https://tangled.sh/%s"/>`,
336
fullName,
337
fullName,
338
)
···
317
318
// this should serve the go-import meta tag even if the path is technically
319
// a 404 like tangled.sh/oppi.li/go-git/v5
320
+
//
321
+
// we're keeping the tangled.sh go-import tag too to maintain backward
322
+
// compatiblity for modules that still point there. they will be redirected
323
+
// to fetch source from tangled.org
324
func (mw Middleware) GoImport() middlewareFunc {
325
return func(next http.Handler) http.Handler {
326
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
···
336
if r.Header.Get("User-Agent") == "Go-http-client/1.1" {
337
if r.URL.Query().Get("go-get") == "1" {
338
html := fmt.Sprintf(
339
+
`<meta name="go-import" content="tangled.sh/%s git https://tangled.sh/%s"/>
340
+
<meta name="go-import" content="tangled.org/%s git https://tangled.org/%s"/>`,
341
fullName,
342
fullName,
343
)
+4
appview/pages/templates/repo/fragments/meta.html
+4
appview/pages/templates/repo/fragments/meta.html