kopia lustrzana https://github.com/micropython/micropython-lib
urequests: A Location-header with a 2XX status is not a redirect.
When using the POST method you get the Location of the new object in a Location header but it's not a redirect. For details see for example RFC2616 10.2.2 and 10.2.3pull/164/head
rodzic
53193ba2e7
commit
6ce081133c
|
@ -85,7 +85,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None):
|
||||||
if l.startswith(b"Transfer-Encoding:"):
|
if l.startswith(b"Transfer-Encoding:"):
|
||||||
if b"chunked" in l:
|
if b"chunked" in l:
|
||||||
raise ValueError("Unsupported " + l)
|
raise ValueError("Unsupported " + l)
|
||||||
elif l.startswith(b"Location:"):
|
elif l.startswith(b"Location:") and not 200 <= status <= 299:
|
||||||
raise NotImplementedError("Redirects not yet supported")
|
raise NotImplementedError("Redirects not yet supported")
|
||||||
|
|
||||||
resp = Response(s)
|
resp = Response(s)
|
||||||
|
|
Ładowanie…
Reference in New Issue