Closed merretbuurman closed 8 years ago
I've fixed this and issued PR #85 . The fix was tested, but is not covered by unit-tests yet.
This issue is fixed and will be closed when the next version is released.
Fixed in release 1.0.3, released on 2016-07-21.
Behaviour: When http instead of https is used, handle creation is not carried out but NO ERROR IS THROWN (when trying to overwrite existing handles). In case the handles did not exist, a 404 Error is thrown, instead of creating the handle.
Explanation: When a HTTP request is redirected to HTTPS using a 302 code, the python.requests library changed the request verb from GET to PUT, to imitate common browser behaviour (see [0,1,2]). If we try to create a handle that already exist (overwrite), this GET request returns a 200, which the library interprets as creation success. Thus, no error is thrown. If the handle does not exist yet, a 404 is thrown on the GET request - which is confusing for a user, but at least it's a noticeable error.
[0] https://github.com/request/request/issues/29 [1] Code lines in requests.sessions:
Do what the browsers do, despite standards...
[2] German Wikipedia says: "Die Browser folgen meist mit einem GET, auch wenn der ursprüngliche Request ein POST war" (browsers usually follow up with a GET even if the original request was a POST.)(https://de.wikipedia.org/wiki/HTTP-Statuscode).