mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
fix(middleware): set baseURL to external host if provided (#369)
This commit is contained in:
@@ -296,6 +296,11 @@ func BaseURLMiddleware(next http.Handler) http.Handler {
|
||||
}
|
||||
baseURL := scheme + "://" + r.Host
|
||||
|
||||
externalHost := config.GetExternalHost()
|
||||
if externalHost != "" {
|
||||
baseURL = externalHost
|
||||
}
|
||||
|
||||
r = r.WithContext(context.WithValue(ctx, BaseURLCtxKey, baseURL))
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user