Skip to content

Commit

Permalink
Rename disable_strip_prefix to disable_strip_slash
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Jan 22, 2019
1 parent 6dd3935 commit 5f03940
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apidef/api_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ type APIDefinition struct {
PreserveHostHeader bool `bson:"preserve_host_header" json:"preserve_host_header"`
ListenPath string `bson:"listen_path" json:"listen_path"`
TargetURL string `bson:"target_url" json:"target_url"`
DisableStripPrefix bool `bson:"disable_strip_prefix" json:"disable_strip_prefix"`
DisableStripSlash bool `bson:"disable_strip_slash" json:"disable_strip_slash"`
StripListenPath bool `bson:"strip_listen_path" json:"strip_listen_path"`
EnableLoadBalancing bool `bson:"enable_load_balancing" json:"enable_load_balancing"`
Targets []string `bson:"target_list" json:"target_list"`
Expand Down
8 changes: 4 additions & 4 deletions reverse_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func TykNewSingleHostReverseProxy(target *url.URL, spec *APISpec) *ReverseProxy
if targetToUse == target {
req.URL.Scheme = targetToUse.Scheme
req.URL.Host = targetToUse.Host
req.URL.Path = singleJoiningSlash(targetToUse.Path, req.URL.Path, spec.Proxy.DisableStripPrefix)
req.URL.Path = singleJoiningSlash(targetToUse.Path, req.URL.Path, spec.Proxy.DisableStripSlash)
if req.URL.RawPath != "" {
req.URL.RawPath = singleJoiningSlash(targetToUse.Path, req.URL.RawPath, spec.Proxy.DisableStripPrefix)
req.URL.RawPath = singleJoiningSlash(targetToUse.Path, req.URL.RawPath, spec.Proxy.DisableStripSlash)
}
}
if !spec.Proxy.PreserveHostHeader {
Expand Down Expand Up @@ -317,8 +317,8 @@ func defaultTransport() *http.Transport {
}
}

func singleJoiningSlash(a, b string, disableStripPrefix bool) string {
if disableStripPrefix && len(b) == 0 {
func singleJoiningSlash(a, b string, disableStripSlash bool) string {
if disableStripSlash && len(b) == 0 {
return a
}
a = strings.TrimRight(a, "/")
Expand Down

0 comments on commit 5f03940

Please sign in to comment.