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

fix some errors on error_exception.php #308

Merged
merged 5 commits into from
Nov 22, 2016

Conversation

ridho1991
Copy link
Contributor

fix some errors related to request & response on error_exception.php

@startbbs
Copy link

hope to fix this bug soon!!

Copy link
Member

@lonnieezell lonnieezell left a comment

Choose a reason for hiding this comment

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

Changing the $request to $response makes sense. That was my typo.

However, I unsure what the bug is in lines 283-286 that you're replacing. It shouldn't be an array because it's calling the getHeaderLine() which combines them into a single string value.

@ridho1991
Copy link
Contributor Author

Yes, you're correct. But, $headers will contain array if we do a POST request.

Array
(
    [Content-Type] => Array
        (
            [0] => CodeIgniter\HTTP\Header Object
                (
                    [name:protected] => Content-Type
                    [value:protected] => multipart/form-data; boundary=----WebKitFormBoundaryUySNXbRhRi3diH2u
                )

            [1] => CodeIgniter\HTTP\Header Object
                (
                    [name:protected] => Content-Type
                    [value:protected] => multipart/form-data; boundary=----WebKitFormBoundaryUySNXbRhRi3diH2u
                )

        )

    [Cookie] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Cookie
            [value:protected] => debug-bar-state=minimized; 60073c17a69bb94bb1f7470c078d8173=ID; 6f68e447328a254d01408c4d22d81aec=114.120.239.212
        )

    [Accept-Language] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Accept-Language
            [value:protected] => en-US,en;q=0.8
        )

    [Accept-Encoding] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Accept-Encoding
            [value:protected] => gzip, deflate
        )

    [Referer] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Referer
            [value:protected] => http://ci4.local/
        )

    [Accept] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Accept
            [value:protected] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
        )

    [User-Agent] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => User-Agent
            [value:protected] => Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
        )

    [Upgrade-Insecure-Requests] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Upgrade-Insecure-Requests
            [value:protected] => 1
        )

    [Origin] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Origin
            [value:protected] => http://ci4.local
        )

    [Cache-Control] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Cache-Control
            [value:protected] => max-age=0
        )

    [Content-Length] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Content-Length
            [value:protected] => 285
        )

    [Connection] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Connection
            [value:protected] => keep-alive
        )

    [Host] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Host
            [value:protected] => ci4.local
        )

    [Mod-Rewrite] => CodeIgniter\HTTP\Header Object
        (
            [name:protected] => Mod-Rewrite
            [value:protected] => on
        )

)

I see you do a same thing in this commit, file toolbar.tpl.php lines 191-200.

But, it's up to you, I will revert back some changes in lines 283-286 to previous state if you wish.

@lonnieezell
Copy link
Member

Good point. I was likely being lazy on that last fix. :)

I need to go back through the HTTP spec because it doesn't make sense to me that should work - having 2 headers by the same name. I'm just afraid it's a deeper problem than the toolbar, so will investigate.

@lonnieezell
Copy link
Member

Alright, just checked the HTTP Message spec and the spec does allow for multiple headers with the same field-name, so it looks like we're good to merge this.

Thanks!

Though it does seem weird that we're getting 2 identical headers on a post request...

@lonnieezell lonnieezell merged commit a944993 into codeigniter4:develop Nov 22, 2016
@ridho1991
Copy link
Contributor Author

You're welcome :-)

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

Successfully merging this pull request may close these issues.

3 participants