add raw handler support

This commit is contained in:
Kevin Pham
2023-12-07 08:43:05 -06:00
parent 6a5b85f260
commit 4779229b32
6 changed files with 56 additions and 10 deletions

View File

@@ -6,16 +6,16 @@ import (
// SetResponseHeader modifies response headers from the upstream server
func SetResponseHeader(key string, value string) proxychain.ResponseModification {
return func(px *proxychain.ProxyChain) error {
px.Context.Response().Header.Set(key, value)
return func(chain *proxychain.ProxyChain) error {
chain.Context.Set(key, value)
return nil
}
}
// DeleteResponseHeader removes response headers from the upstream server
func DeleteResponseHeader(key string) proxychain.ResponseModification {
return func(px *proxychain.ProxyChain) error {
px.Context.Response().Header.Del(key)
return func(chain *proxychain.ProxyChain) error {
chain.Context.Response().Header.Del(key)
return nil
}
}