Skip to content
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

Question #8

Closed
harikt opened this issue Apr 16, 2015 · 3 comments
Closed

Question #8

harikt opened this issue Apr 16, 2015 · 3 comments

Comments

@harikt
Copy link

harikt commented Apr 16, 2015

Hi,

I was going through the guzzle code, have a doubt regarding the implementation

$new->headers[strtolower($header)][] = $value;

Doesn't it need to preserve the case sensitivity? See

https://github.com/php-fig/http-message/blob/f3218d1cdf479cd9a65d568f605edbc17c6df82a/src/MessageInterface.php#L118

While header names are case-insensitive, the casing of the header will be preserved by this function, and returned from getHeaders()

and I am seeing

return $this->headerLines;

public function getHeaders()
{
    return $this->headerLines;
}

I understand it finally is returning the preserved value. But does headerLines in headers is a bit confusing? I wished the variable name is like

public function getHeaders()
{
    return $this->headers;
}

public function getHeaderLines()
{
    return $this->headerLines;
}

Thank you

@mtdowling
Copy link
Member

This repo hasn't been updated to reflect recent changes to psr-7. We hope to get to it soon though.

On Apr 16, 2015, at 8:37 AM, Hari K T notifications@github.com wrote:

Hi,

I was going through the guzzle code, have a doubt regarding the implementation

$new->headers[strtolower($header)][] = $value;

Doesn't it need to preserve the case sensitivity? See

https://github.com/php-fig/http-message/blob/f3218d1cdf479cd9a65d568f605edbc17c6df82a/src/MessageInterface.php#L118

While header names are case-insensitive, the casing of the header will be preserved by this function, and returned from getHeaders()
and I am seeing

return $this->headerLines;

public function getHeaders()
{
return $this->headerLines;
}
I understand it finally is returning the preserved value. But does headerLines in headers is a bit confusing? I wished the variable name is like

public function getHeaders()
{
return $this->headers;
}

public function getHeaderLines()
{
return $this->headerLines;
}
Thank you


Reply to this email directly or view it on GitHub.

@harikt
Copy link
Author

harikt commented Apr 16, 2015

Thank you @mtdowling for the fast reply.

@mtdowling
Copy link
Member

Everything should now be up to date

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

No branches or pull requests

2 participants