Skip to content
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

Fix error when Instagram return lowercase "content-location" #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zztalker
Copy link

Catch a strange error - instagram return in headers lowercased "content-location".

@zztalker
Copy link
Author

There is the error in design because of the response of request module already lowercase headers. And enough to make one check ('content-location' in response).

@wkoot
Copy link
Owner

wkoot commented May 24, 2018

Why not response.get('content-location', response['Content-Location']) ?

Anyway - the Instagram v1 API this library uses, has been deprecated and will be discontinued.
A lot of instagram endpoints are already no longer available: https://www.instagram.com/developer/changelog/

@zztalker
Copy link
Author

zztalker commented May 24, 2018

Because response['Content-Location'] rise KeyError exception.
But it's still working, and why not to fix some errors - and publish it on PyPI warehouse?

@wkoot
Copy link
Owner

wkoot commented May 28, 2018

The point is that it should not fail silently; either 'Content-Location' or 'content-location' should be tried.
If neither of these headers are there, raising an exception is correct. Might be nicer to raise a OAuth2AuthExchangeError ofc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants