python-instagram icon indicating copy to clipboard operation
python-instagram copied to clipboard

Fix error when Instagram return lowercase "content-location"

Open zztalker opened this issue 6 years ago • 4 comments

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

zztalker avatar May 22 '18 14:05 zztalker

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).

zztalker avatar May 22 '18 18:05 zztalker

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/

wkoot avatar May 24 '18 11:05 wkoot

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?

zztalker avatar May 24 '18 13:05 zztalker

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

wkoot avatar May 28 '18 10:05 wkoot