6 changed files with 50 additions and 16 deletions
-
4activityPub.go
-
34config.go
-
8http.go
-
3postsFuncs.go
-
15shortDomain.go
-
2webmention.go
@ -0,0 +1,15 @@ |
|||
package main |
|||
|
|||
import ( |
|||
"net/http" |
|||
) |
|||
|
|||
func redirectShortDomain(next http.Handler) http.Handler { |
|||
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { |
|||
if appConfig.Server.shortPublicHostname != "" && r.Host == appConfig.Server.shortPublicHostname { |
|||
http.Redirect(rw, r, appConfig.Server.PublicAddress+r.RequestURI, http.StatusMovedPermanently) |
|||
return |
|||
} |
|||
next.ServeHTTP(rw, r) |
|||
}) |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue