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

[http] Adapt header field name validation to RFC definition #5301

Closed
wants to merge 1 commit into from
Closed

[http] Adapt header field name validation to RFC definition #5301

wants to merge 1 commit into from

Conversation

Maks3w
Copy link
Member

@Maks3w Maks3w commented Oct 20, 2013

No description provided.

@@ -69,13 +69,17 @@ public function setFieldName($fieldName)
throw new Exception\InvalidArgumentException('Header name must be a string');
}

// Pre-filter to normalize valid characters, change underscore to dash
$fieldName = str_replace(' ', '-', ucwords(str_replace(array('_', '-'), ' ', $fieldName)));
Copy link
Member Author

Choose a reason for hiding this comment

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

@ralphschindler @weierophinney Why this was needed?

Copy link
Member

Choose a reason for hiding this comment

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

Apache, basically. The PhpEnvironment-specfic request object may pull the headers from get_headers(), and those often substitute underscores for dashes.

weierophinney added a commit that referenced this pull request Oct 22, 2013
[http] Adapt header field name validation to RFC definition
weierophinney added a commit that referenced this pull request Oct 22, 2013
- s/_/-/ in header field names
weierophinney added a commit that referenced this pull request Oct 22, 2013
@ghost ghost assigned weierophinney Oct 22, 2013
@ghost
Copy link

ghost commented Feb 15, 2014

Causes a BC break in code being used against OAuth2 spec servers. Should be a configurable option (default off).

@Maks3w
Copy link
Member Author

Maks3w commented Feb 15, 2014

@fuashley Please open a new issue with your problem. This thread is closed

weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
…x/http-fieldname-check

[http] Adapt header field name validation to RFC definition
weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants