add ruleset path support

This commit is contained in:
Kevin Pham
2023-12-07 09:23:12 -06:00
parent 4779229b32
commit 8166eb31af
5 changed files with 87 additions and 9 deletions

View File

@@ -283,10 +283,6 @@ func (chain *ProxyChain) extractURLFromSubdomain() (*url.URL, error) {
func (chain *ProxyChain) extractURLFromPath() (*url.URL, error) {
reqURL := chain.Context.Params("*")
fmt.Println("XXXXXXXXXXXXXXXX")
fmt.Println(reqURL)
fmt.Println(chain.APIPrefix)
reqURL = strings.TrimPrefix(reqURL, chain.APIPrefix)
// sometimes client requests doubleroot '//'
@@ -530,7 +526,6 @@ func (chain *ProxyChain) Execute() error {
}
// in case api user did not set or forward content-type, we do it for them
// warning: the fiber method chain.Context.Get() doesn't seem to work as described
ct := chain.Context.Response().Header.Peek("content-type")
CT := chain.Context.Response().Header.Peek("Content-Type")
if ct == nil && CT == nil {