~elektito/hodhod

4b698dcdcc27d08585ce31b23cba59c02d343460 — Mostafa Razavi 1 year, 3 months ago f33ad68
Do not modify request URL when matching

We were modifying the passed URL in GetBackendByUrl, which cause an
incomplete URL be passed to CGI scripts (queries removed, etc).
1 files changed, 1 insertions(+), 1 deletions(-)

M pkg/hodhod/config.go
M pkg/hodhod/config.go => pkg/hodhod/config.go +1 -1
@@ 105,7 105,7 @@ func (cfg *Config) GetBackendByName(name string) *Backend {
	return nil
}

func (cfg *Config) GetBackendByUrl(u *url.URL) (backend *Backend, unmatched string) {
func (cfg *Config) GetBackendByUrl(u url.URL) (backend *Backend, unmatched string) {
	if cfg.MatchOptions.QueryParams != "include" {
		u.RawQuery = ""
	}