Instagram API error 500 UTF-8 hashtags with enforced signature

安稳与你 提交于 2019-12-03 00:47:03

I think this issue is apparently a bug of Instagram API.
I tested various request patterns.

"Enforce signed requests" is enabled

/v1/tags/search?access_token=<access token>&q=%e3%81%82&sig=<correct sig>

-> 500 (expected 200)

/v1/tags/search?access_token=<access token>&q=%e3%81%82&sig=<incorrect sig>

-> 500 (expected 403)

/v1/tags/search?access_token=<access token>&q=%e3%81%82

-> 403 (as expected)

/v1/tags/search?access_token=<access token>&q=abc&sig=<correct sig>

-> 200 (as expected)

"Enforce signed requests" is disabled

/v1/tags/search?access_token=<access token>&q=%e3%81%82&sig=<correct sig>

-> 200 (as expected)

/v1/tags/search?access_token=<access token>&q=%e3%81%82&sig=<incorrect sig>

-> 403 (as expected)

When "Enforce signed requests" is enabled, a request which has non-ascii utf-8 characters in its uri always get 500. If turn off it, everything work fine. This is apparently not an issue caused by incorrect sig parameter or wrong encoding.
I already reported this issue to Instagram via bugtool 10 days ago. No reaction from them so far.
(Sorry to answer again. My 1st answer was deleted.)

[UPDATE 5 Sep.]
At last, this issue seems to be fixed.
My IG app works fine with Enforce Signed Requests setting now.
Note: If an endpoint uri has url-encoded characters (such as /tags/%E3%81%82/media/recent), you need to generate sig parameter from decoded endpoint string.

I just received a message from Instagram telling me that it really was a bug and it is now fixed! \o/

Hi, Thanks for your report and interest in the Instagram platform. The issue has been fixed. Best, Jackie - Instagram team

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!