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

response headers handling - same key, different values #57

Open
dneves opened this issue Sep 18, 2014 · 0 comments
Open

response headers handling - same key, different values #57

dneves opened this issue Sep 18, 2014 · 0 comments

Comments

@dneves
Copy link

dneves commented Sep 18, 2014

If the server sends 2 or more headers with the same key, the last_headers array contains only the last header sent from the server in the corresponding key.

for example, if the server sends 2 http Link headers in the response,
Link: <SOME_URL>; rel="REL_NAME"
Link: <SOME_SECOND_URL>; rel="SECOND_REL_NAME"
, only the second is saved in the Pest.last_headers array :

private function handle_header($ch, $str) {
        if (preg_match('/([^:]+):\s(.+)/m', $str, $match)) {
            $this->last_headers[strtolower($match[1])] = trim($match[2]);
        }
        return strlen($str);
    }

this handler replaces headers with the same name.

if i make the same request directly in chrome, in the network tab i can see it parses all headers...

do you have any plans on fixing this ?

Thank you.
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

1 participant