Skip to content

Fix checking maximum header size, do not take start of body into account #88

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

Merged

Conversation

nopolabs
Copy link
Contributor

@nopolabs nopolabs commented Feb 5, 2017

Fixed check for exceeding maximum header size in RequestHeaderParser::feed()

@clue
Copy link
Member

clue commented Feb 5, 2017

Thanks for filing this PR 👍

Unfortunately it has no tests, see also #82.

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @clue mentions could you add tests?

src/Server.php Outdated
@@ -41,6 +41,9 @@ public function __construct(SocketServerInterface $io)
$conn->emit('resume');
});
});
$parser->on('error', function($exception) {
$this->emit('error', [$exception]);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is in this PR? (It does make sense to do this non the less.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this has been addressed in #83

@WyriHaximus WyriHaximus added this to the v0.4.3 milestone Feb 5, 2017
@nopolabs nopolabs force-pushed the fix/header-size-in-RequestHeaderParser branch from 5fb8f9e to c4c1aec Compare February 5, 2017 19:10
@nopolabs
Copy link
Contributor Author

nopolabs commented Feb 5, 2017

added test

removed bubble up of error from Server.php, not related to this issue

@WyriHaximus
Copy link
Member

added test

Test look good, but now this test is failing

removed bubble up of error from Server.php, not related to this issue

Great, thanks 👍

@nopolabs nopolabs force-pushed the fix/header-size-in-RequestHeaderParser branch 2 times, most recently from 6e3c57d to 97ac89c Compare February 5, 2017 19:50
@WyriHaximus WyriHaximus requested review from jsor and clue February 5, 2017 19:53
Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@@ -81,8 +81,9 @@ public function testParserErrorEmitted()
$conn = new ConnectionStub();
$io->emit('connection', [$conn]);

$data = $this->createGetRequest();
$data = str_pad($data, 4096 * 4);
$data = chop($this->createGetRequest());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay, but could probably be a bit clearer. What do you think, should this be updated to use a literal request string here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, thanks for the suggestion.

@nopolabs nopolabs force-pushed the fix/header-size-in-RequestHeaderParser branch from 97ac89c to 5dc78e7 Compare February 5, 2017 20:39
Copy link
Member

@jsor jsor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@clue clue added the bug label Feb 6, 2017
@clue clue changed the title check max header size Fix checking maximum header size, do not take start of body into account Feb 6, 2017
@clue clue merged commit 8d6272a into reactphp:master Feb 6, 2017
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.

4 participants