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

Disable body and content-type header signature when content-type is m… #50

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

Conversation

zefrog
Copy link

@zefrog zefrog commented Jan 3, 2019

…ultipart/form-data
Hello,
I've been using this library to authenticate access to some Symfony webservices. It has been working great until some of my webservices required content to be sent in multipart/form-data (file upload).
Given that the body is not empty and that there is a Content-Type header, these parts are added to be signed by the AuthorizationHeaderBuilder when the request is sent.

But as per the php documentation (http://php.net/manual/en/wrappers.php.php) the php://input is not available when the Content-Type is multipart/form-data, so when the signature is checked it considers the body empty and the RequestAuthenticator class does not compute the same signature.

With this PR I propose to disable the signature of the body and the Content-Type header when the request Content-Type is multipart/form-data.
NB. I've been successfully consuming my multipart/form-data webservices using the JS library which it seems does not include the body nor the Content-Type header to the signature.

Thank you for your awesome work!

@acquia-stalebot-platauto
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

1 participant