Skip to content

Commit

Permalink
fix static prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyale committed Jan 17, 2021
1 parent bb081d8 commit 138decb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func ReverseHandlerFunc(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, targetFile)
return
}
staticHandler.ServeHTTP(w, r)
http.StripPrefix(dest.RequestRoute, staticHandler).ServeHTTP(w, r)
return
} else if dest.RouteType == models.FastCGIRoute {
// FastCGI
Expand Down
6 changes: 4 additions & 2 deletions gateway/gateway_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ import (
func rewriteResponse(resp *http.Response) (err error) {
r := resp.Request
app := backend.GetApplicationByDomain(r.Host)
locationURL, err := resp.Location()
if locationURL != nil {
locationStr := resp.Header.Get("Location")
indexHTTP := strings.Index(locationStr, "http")
if indexHTTP == 0 {
locationURL, _ := resp.Location()
host := locationURL.Hostname()
port := locationURL.Port()
var oldHost, newHost string
Expand Down
1 change: 1 addition & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ printf "Checklist:\n"
printf "* Angular Admin Version Check. \n"
printf "* Janusec Version Check. \n"
version=`./janusec --version`
printf "Version: ${version} \n"
dist_dir="./dist/janusec-${version}/"
mkdir -p ${dist_dir}
\cp -f ./janusec ${dist_dir}
Expand Down

0 comments on commit 138decb

Please sign in to comment.