-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using VCR.py causes 404 for Flickr upload specifically :S #31
Comments
Let me know if you can reproduce this problem. In a similar vein, I've written a single test to demonstrate the problem: def flickr_should_respond_with_200():
r = requests.post("http://api.flickr.com/services/upload")
r.status_code.should.be.equal(200) # FINE
with vcr.use_cassette('fixtures/flickr/reach.yaml'):
r = requests.post("http://api.flickr.com/services/upload")
r.status_code.should.be.equal(200) # NOT FINE I ran this test with Wireshark says that no request is made within the I'm so close to being a happy user of vcrpy, but it just needs to be more robust! The patching and hackery of HTTP connection classes make it hard for me to contribute back to the project in a timely manner. |
Using another URL, such as |
Yes, I can reproduce the problem. How bizarre! |
Ahh it looks like the Host header is disappearing somehow. That would explain the 404. |
Never mind, I think the problem is that it is sending the POST to the full URL including protocol. Here is the raw data sent down the socket by VCR:
Here is what unVCR'd httplib sends:
Here is what curl sends:
|
Gotta run to work but that must be the problem! |
Looks like Flickr's API server is actually out of spec:
To be fair, VCR is out of spec too :) |
Ah cool! Impressive skill. For some reason I had Wireshark and it didn't occur to me that I should compare the requests. Well, now the mystery is solved, what's the fix? Will VCR have to use the path segment rather than the full URL to save all those poor out-of-spec servers of our Internet from getting confused? =] |
More problems with posting. This is very strange behaviour:
Instead of transparently recording the requests that occur, VCR has completely hi-jacked the call somehow:
The text was updated successfully, but these errors were encountered: