Comments (3)
maybe have some simple code to disable redirect?
from grequests.
utils.go
func addRedirectFunctionality(client *http.Client, ro *RequestOptions) {
if client.CheckRedirect != nil {
return
}
client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
// here is new code
if ro.RedirectLimit == -1{
return http.ErrUseLastResponse
}
//over
if ro.RedirectLimit == 0 {
ro.RedirectLimit = RedirectLimit
}
if len(via) >= ro.RedirectLimit {
return ErrRedirectLimitExceeded
}
if ro.SensitiveHTTPHeaders == nil {
ro.SensitiveHTTPHeaders = SensitiveHTTPHeaders
}
for k, vv := range via[0].Header {
// Is this a sensitive header?
if _, found := ro.SensitiveHTTPHeaders[k]; found {
continue
}
for _, v := range vv {
req.Header.Add(k, v)
}
}
return nil
}
}
from grequests.
I actually just found out that you posted this issue. I created a pull request #75 that fixes this. Hopefully @levigross will see it the same way.
from grequests.
Related Issues (20)
- http proxy setting does not work when try to access websites with https HOT 2
- Response not getting cached when using .Bytes() or .String() methods HOT 1
- Question: override DNS resolution? HOT 1
- EOF happens when sending a lot fo requests
- grequests.addRedirectFunctionality() data race HOT 1
- how to set proxy after session created? HOT 3
- Why can't i add Transfer-Encoding to header HOT 2
- Repeated addition of HTTP headers
- http请求头重复 bug HTTP request header duplicates bugs
- Don't set a default filename when sending multipart form
- support send request with raw message in body HOT 1
- how to post a file using file received from gin's c.FormFile? HOT 2
- Export Response struct
- proxy not working on adding to session at the time of request
- tcp io timeout
- Add SECURITY.md
- session.RequestOptions.Cookies not combine into request
- State of the library? HOT 1
- 大佬你还更新吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grequests.