begin refactor of proxy engine

This commit is contained in:
Kevin Pham
2023-11-18 08:31:59 -06:00
parent 6d8e943df5
commit f6341f2c3e
24 changed files with 917 additions and 77 deletions

View File

@@ -0,0 +1,19 @@
package rsm // ReSponseModifers
import (
"ladder/proxychain"
)
// BypassCSP modifies response headers to prevent the browser
// from enforcing any CORS restrictions
func BypassCSP() proxychain.ResponseModification {
return func(px *proxychain.ProxyChain) error {
px.AddResultModifications(
ModifyResponseHeader("Access-Control-Allow-Origin", "*"),
ModifyResponseHeader("Access-Control-Expose-Headers", "*"),
ModifyResponseHeader("Access-Control-Allow-Credentials", "true"),
ModifyResponseHeader("Access-Control-Allow-Methods", ""),
)
return nil
}
}