elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.06k stars 1.1k forks source link

Semicolon in URL query #511

Closed krum110487 closed 1 year ago

krum110487 commented 1 year ago

I am using the proxy for a project and there is a site that uses semicolons in the query and go http hates it. Gives a warning. How would I go about modifying the RawQuery before onrequest to replace the semicolons?

Is that possible, I've been struggling to find a solution.

Just to be clear this is a golang http library error: http: URL query contains semicolon, which is no longer a supported separator; parts of the query may be stripped when parsed; see golang.org/issue/25192

I am just trying to work around it and I am not sure how to achieve that!

krum110487 commented 1 year ago

I was overthinking this!

I found this functionality was built in already!!

log.Fatal(http.ListenAndServe(":"+proxySettings.ProxyPort, http.AllowQuerySemicolons(proxy)))