Merge branch 'hotfix/assets'
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Maxim Lebedev 2023-01-16 18:11:27 +06:00
commit 0b8a1317d5
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
2 changed files with 11 additions and 8 deletions

2
assets/.gitignore vendored
View File

@ -1,2 +0,0 @@
*.fasthttp.br
*.fasthttp.gz

17
main.go
View File

@ -350,17 +350,22 @@ func (app *App) Handler() http.Handler {
head, r.URL.Path = urlutil.ShiftPath(r.URL.Path) head, r.URL.Path = urlutil.ShiftPath(r.URL.Path)
switch head { switch head {
default: case "", "callback", "token", "introspect", "revocation":
r.URL = r.URL.JoinPath(head, r.URL.Path) r.URL = r.URL.JoinPath(head, r.URL.Path)
default:
if r.URL.Path != "/" {
r.URL = r.URL.JoinPath(head, r.URL.Path)
} else {
r.URL = r.URL.JoinPath(head)
}
}
switch head {
default:
static.ServeHTTP(w, r) static.ServeHTTP(w, r)
case "", "callback": case "", "callback":
r.URL = r.URL.JoinPath(head, r.URL.Path)
client.ServeHTTP(w, r) client.ServeHTTP(w, r)
case "token", "introspect", "revocation": case "token", "introspect", "revocation":
r.URL = r.URL.JoinPath(head, r.URL.Path)
token.ServeHTTP(w, r) token.ServeHTTP(w, r)
case ".well-known": case ".well-known":
if head, _ = urlutil.ShiftPath(r.URL.Path); head == "oauth-authorization-server" { if head, _ = urlutil.ShiftPath(r.URL.Path); head == "oauth-authorization-server" {
@ -377,5 +382,5 @@ func (app *App) Handler() http.Handler {
case "ticket": case "ticket":
ticket.ServeHTTP(w, r) ticket.ServeHTTP(w, r)
} }
}).Intercept(middleware.LogFmt())) }) /*.Intercept(middleware.LogFmt())*/)
} }