fix "modifer" -> "modifier" typo everywhere
This commit is contained in:
22
proxychain/requestmodifiers/request_google_cache.go
Normal file
22
proxychain/requestmodifiers/request_google_cache.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package requestmodifiers
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"ladder/proxychain"
|
||||
)
|
||||
|
||||
const googleCacheUrl string = "https://webcache.googleusercontent.com/search?q=cache:"
|
||||
|
||||
// RequestGoogleCache modifies a ProxyChain's URL to request its Google Cache version.
|
||||
func RequestGoogleCache() proxychain.RequestModification {
|
||||
return func(px *proxychain.ProxyChain) error {
|
||||
encodedURL := url.QueryEscape(px.Request.URL.String())
|
||||
newURL, err := url.Parse(googleCacheUrl + encodedURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
px.Request.URL = newURL
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user