Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Avoid triggering a notice with special crafted accept headers #58

Conversation

theboolean
Copy link
Contributor

Avoid triggering a notice when an accept header without an equal sign is parsed.

Refs #57

@Freeaqingme
Copy link
Member

@theboolean Thanks for your Pull Request! Could you perhaps try to also include a test case as a unit test so we can be sure this bug won't resurface again, for example when someone refactors this class? Thanks!

@theboolean theboolean force-pushed the fix/handle-accept-headers-without-equal-sign branch from 9015de6 to 9727eb3 Compare May 19, 2016 15:57
Test correct handling of accept headers with semicolon without equal sign
@theboolean theboolean force-pushed the fix/handle-accept-headers-without-equal-sign branch from 9727eb3 to 851b568 Compare May 19, 2016 16:07
Test correct handling of accept headers with trailing semicolon
@theboolean
Copy link
Contributor Author

Hi @Freeaqingme, I added the test, and as you can see I rewrote the history of my branch putting it before my patch, so it is clear that the test failed before it.
I also added another edge case test that passed also before applying my patch, just in case.

@theboolean theboolean force-pushed the fix/handle-accept-headers-without-equal-sign branch 2 times, most recently from 0195424 to cd52116 Compare May 19, 2016 16:29
Test correct handling of accept headers with trailing semicolon and with semicolon without equal sign
@theboolean theboolean force-pushed the fix/handle-accept-headers-without-equal-sign branch from cd52116 to 56a297f Compare May 19, 2016 16:34
@Freeaqingme
Copy link
Member

Awesome!

@weierophinney Given how all tests pass this looks good to me, but I've been out of it for a while. So perhaps this is something you could look at as well?

@ezimuel ezimuel self-assigned this Aug 3, 2016
@ezimuel ezimuel merged commit 56a297f into zendframework:master Aug 3, 2016
@ezimuel
Copy link
Contributor

ezimuel commented Aug 3, 2016

@theboolean Thanks for your contribution!

@theboolean theboolean deleted the fix/handle-accept-headers-without-equal-sign branch August 4, 2016 07:30
@theboolean
Copy link
Contributor Author

@ezimuel you're welcome!
If it looks good to you, you can also close the issue related to this PR (#57).

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

Successfully merging this pull request may close these issues.

3 participants