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

BC break? - Fix for issue #81 - silently skip invalid header values coming in from clients #84

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

sgehrig
Copy link
Contributor

@sgehrig sgehrig commented Aug 30, 2016

silently skip invalid header values coming in from a client

instead of throwing exceptions on invalid headers from clients, the new code silently skips these header values and continues to parse the header for a best match

instead of throwing exceptions on invalid headers from clients, the new code silently skips these header values and continues to parse the header for a best match
@willdurand
Copy link
Owner

Great!

@willdurand willdurand changed the title BC break fix for issue #81 - silently skip invalid header values coming in from clients BC break? - Fix for issue #81 - silently skip invalid header values coming in from clients Aug 30, 2016
@willdurand
Copy link
Owner

Wondering if this is a BC break to be honest. The "BC break" is actually the bug itself, hence it is a bugfix IMO.. I know the behavior of the lib will change because it will not throw an exception anymore, but that behavior was faulty.

@sgehrig
Copy link
Contributor Author

sgehrig commented Aug 30, 2016

You're right. I think it's easy to argue that it's not a BC break because, as you said, the original implementation had some flaws.

@sgehrig
Copy link
Contributor Author

sgehrig commented Aug 30, 2016

https://twitter.com/phpalcohol/status/770562475951550464:

phpalcohol: @couac does the change break your API or not (were the exceptions explicitly part of your API declaration)? @lsmith

I think this is a good argument.

@willdurand willdurand merged commit 1ebc51d into willdurand:master Aug 30, 2016
@willdurand willdurand added this to the 2.0.3 milestone Aug 30, 2016
@willdurand
Copy link
Owner

thanks @sgehrig!

@sgehrig sgehrig deleted the issue-81-2 branch August 30, 2016 11:09
@stof
Copy link

stof commented Aug 30, 2016

@sgehrig you should rebase your branch so that the commit diff contains only the relevant changes instead of adding changes from other commits in your patch.

Anyway, I think this one qualifies as a bug fix (rejecting the whole negotiation when the client submits an invalid header value among others does not loo like something to be considered as a feature)

@sgehrig
Copy link
Contributor Author

sgehrig commented Aug 30, 2016

@stof: I think the PR contained only changes done to fix this issue. It was based on master from somehow this morning - so I think it was the most recent master branch available. The other PR (#82) was a different way to tackle the problem - but it wasn't complete.

@dunglas
Copy link
Contributor

dunglas commented Aug 30, 2016

This is indeed a BC break: https://travis-ci.org/api-platform/core/jobs/156291020

@willdurand
Copy link
Owner

@dunglas do you agree that the behavior was incorrect?

@dunglas
Copy link
Contributor

dunglas commented Aug 30, 2016

Yes, this change will allow me to remove some useless code.
However it may impact other people.

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

Successfully merging this pull request may close these issues.

4 participants