mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
sync
This commit is contained in:
@@ -161,6 +161,9 @@ func (obj *Response) SSE() *SSE {
|
||||
|
||||
// return URL redirected address
|
||||
func (obj *Response) Location() (*url.URL, error) {
|
||||
if obj.filePath != "" {
|
||||
return nil, nil
|
||||
}
|
||||
u, err := obj.response.Location()
|
||||
if err == http.ErrNoLocation {
|
||||
err = nil
|
||||
@@ -246,7 +249,7 @@ func (obj *Response) SetContent(val []byte) {
|
||||
|
||||
// return content with []byte
|
||||
func (obj *Response) Content() []byte {
|
||||
if obj.webSocket == nil && obj.sse == nil {
|
||||
if obj.webSocket == nil && obj.sse == nil && obj.filePath == "" {
|
||||
obj.ReadBody()
|
||||
}
|
||||
return obj.content
|
||||
|
||||
Reference in New Issue
Block a user