Add support for POST requests to /v1/openid/authorize_return
Some OpenID providers make a POST request to the `return_to` URL if the query string would be too long. This commit adds support for POST requests to this endpoint. The change in notification_hook.py is to stop attempting to parse the empty string as JSON when receiving this POST request. Change-Id: I34d7032d795a5d36799bffc51864e63e585c6eb1
This commit is contained in:
parent
4c1c7c0cfc
commit
8c7604ffe0
@ -37,7 +37,7 @@ class AuthController(rest.RestController):
|
||||
|
||||
_custom_actions = {
|
||||
"authorize": ["GET"],
|
||||
"authorize_return": ["GET"],
|
||||
"authorize_return": ["GET", "POST"],
|
||||
"token": ["POST"],
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ class NotificationHook(hooks.PecanHook):
|
||||
# On a POST method, the server has assigned an ID to the resource,
|
||||
# so we should be getting it from the resource rather than the URL.
|
||||
if state.request.method == 'POST':
|
||||
response_body = json.loads(response.body)
|
||||
if response_body:
|
||||
if response.body:
|
||||
response_body = json.loads(response.body)
|
||||
if not subresource:
|
||||
resource_id = response_body.get('id')
|
||||
elif subresource == 'comment':
|
||||
|
Loading…
Reference in New Issue
Block a user