Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions testdata/request-parse-errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
if ($lastError && $lastError['type'] === E_WARNING) {
http_response_code(400);
echo $lastError['message'];
// The last error persists between requests like userland state
error_clear_last();
}

++$requests;
Expand Down
2 changes: 1 addition & 1 deletion worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestWorkerSurvivesRequestParseErrors(t *testing.T) {
assert.Contains(t, body2, "requests:2")
assert.Contains(t, body2, "exceeds the limit")

// clean request: recorded errors must be reset between requests
// clean request: the script cleared the previous error itself
body3, resp3 := testGet("http://example.com/request-parse-errors.php", handler, t)
assert.Equal(t, http.StatusOK, resp3.StatusCode)
assert.Contains(t, body3, "requests:3")
Expand Down
Loading