-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Sent out a status text for unknown HTTP headers. #16588
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
Sent out a status text for unknown HTTP headers. #16588
Conversation
See https://bz.apache.org/bugzilla/show_bug.cgi?id=44995 and https://bz.apache.org/bugzilla/show_bug.cgi?id=54946 on why Apache refuses empty |
@@ -454,7 +454,7 @@ public function setStatusCode($code, $text = null) | |||
} | |||
|
|||
if (null === $text) { | |||
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : ''; | |||
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : 'Unknown status text'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknow Status
only (with caps)? text looks redondant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe all lowercase to differenciate from regular status texts that are "ucwords"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's go with 'unknown status'?
Thank you @dawehner. |
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16588). Discussion ---------- Sent out a status text for unknown HTTP headers. * The HTTP RFC explains that header('HTTP/1.1 418 ') should be fine, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 * Apache itself though is broken, see https://gist.github.com/anonymous/a863d7b493c4b09733ec The fix is to sent out some status text, when we don't know a better text. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- eec6fbc Sent out a status text for unknown HTTP headers.
Doesn't it say it's fixed in Apache? |
The fix is to sent out some status text, when we don't know a better text.