我正在使用这个crhym3/simpleauth在我的项目中使用 Google、Linkedin 和 Twitter 进行 oauth 身份验证。它使用 GAE 的 urlfetch。
Google 计划在 4 月下旬更改 urlfetch 的行为。我在这里转载他们的通知:
Currently, the URL Fetch service preserves your original HTTP method (e.g., GET, POST) when it receives and responds to a 302 Moved Temporarily response. Modern user agents typically issue a GET request in response to a 302. After the update, URL Fetch will only issue a GET request after receiving a 302 response, rather than preserving the original method. This may cause requests to be routed differently and/or return 404s or other errors, and will drop the message body from POST requests.
我已在项目论坛上发布了问题,但尚未收到回复。
我的问题是:
测试该软件免受更改影响的最佳方法是什么?我正在考虑将 follow_redirects=False
添加到 urlfetch 调用中,以查看我从 google、linkedin 和 twitter 获得的重定向。
最佳答案
他们只是遵循规范。我非常确定它们(google、linkedin 和 twitter)都按照规范中的定义接受重定向后的 GET 请求。
所以我认为你不需要做任何事情。
关于python - 4 月份的 urlfetch 更改和 simpleoauth,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29312094/