Skip to content

Check if ENV HTTP_X_FORWARDED_HOST is available before using it#930

Closed
melo wants to merge 1 commit intoPerlDancer:masterfrom
melo:patch-1
Closed

Check if ENV HTTP_X_FORWARDED_HOST is available before using it#930
melo wants to merge 1 commit intoPerlDancer:masterfrom
melo:patch-1

Conversation

@melo
Copy link
Copy Markdown
Contributor

@melo melo commented Jun 11, 2015

No description provided.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

probably use exists instead of autovivificating it?

@veryrusty
Copy link
Copy Markdown
Member

Thanks @melo! Merged with @ambs suggestion plus tests as 765261a. 👯
( This is almost identical to the suggestion in #915 😄 )

@veryrusty veryrusty closed this Jun 12, 2015
@ambs
Copy link
Copy Markdown
Member

ambs commented Jun 12, 2015

👍

@abeverley
Copy link
Copy Markdown
Contributor

The problem with this is that if the header is missing (i.e. the client sent a HTTP/1.0 header without host), then the internal host name is returned in host.

I would have thought it would be better returning an empty string in these circumstances, which I presume is the behaviour you would get if you were not running behind a proxy and the client sent no host header.

@abeverley
Copy link
Copy Markdown
Contributor

See #935.

xsawyerx added a commit that referenced this pull request Jul 8, 2015
    [ BUG FIXES ]
    * GH #915, #930: Check existence of optional extension headers when
      behind proxy. (Andy Beverley, Pedro Melo, Russell Jenkins)
    * GH #926, #940: Set session directory default to $apprdir/session.
      (Russell Jenkins)
    * GH #936, #939: Use the error_template configuration on a 404.
      (Russell Jenkins)
    * GH #844, #937: Non-hash serialized params do not cause a crash. (Sawyer X)
    * GH #943: Pass @_ to UNIVERSAL's VERSION so it validates version number.
      (Sawyer X)
    * GH #934: Cleanup internals in the old Dispatcher. (Russell Jenkins)

    [ DOCUMENTATION ]
    * Sanitize Changes
    * GH #938: Fix POD link to params keyword. (Ludovic Tolhurst-Cleaver)
    * GH #935: Provide more details and considerations when using
      behind_proxy. (Andy Beverley)

    [ ENHANCEMENT ]
    * GH #933: use note in tests to produce cleaner non-verbose output (Vernon)
    * Remove unnecessary dependencies: build chain should be smaller. (Sawyer X)
    * No need for Module::Build. (Sawyer X)
    * GH #911: Dancer2 request object is now a subclass of Plack::Request.
      It's also much faster now. (Sawyer X)
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.

4 participants