git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lars Hjemli" <hjemli@gmail.com>
To: "Eric Wong" <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: Re: [cgit PATCH] use Host: header to generate cgit_hosturl
Date: Tue, 2 Sep 2008 09:24:26 +0200	[thread overview]
Message-ID: <8c5c35580809020024x564e8bc3o410cea6d4cd905@mail.gmail.com> (raw)
In-Reply-To: <20080901233033.GB19984@hand.yhbt.net>

On Tue, Sep 2, 2008 at 1:30 AM, Eric Wong <normalperson@yhbt.net> wrote:
> Lars Hjemli <hjemli@gmail.com> wrote:
>> On Tue, Sep 2, 2008 at 1:07 AM, Eric Wong <normalperson@yhbt.net> wrote:
>> > Lars Hjemli <hjemli@gmail.com> wrote:
>> >> On Mon, Sep 1, 2008 at 8:30 AM, Eric Wong <normalperson@yhbt.net> wrote:
>> >> > So use the "Host" header if it is available and fall back to
>> >> > SERVER_NAME/SERVER_PORT for some clients that don't set
>> >> > HTTP_HOST.
>> >>
>> >> Maybe it would be better to use a new cgitrc parameter as fallback if
>> >> the client doesn't provide the "Host" header?
>> >
>> > That sounds a bit hackish to me since HTTP_HOST, SERVER_NAME and
>> > SERVER_PORT are all standardized.  Anyhow, it's your call :)
>>
>> I just figured that since SERVER_NAME/SERVER_PORT doesn't work in a
>> setup like the one you described, clients which doesn't provide the
>> "Host" header would never get a correct url. A default value for the
>> "Host" header in cgitrc would work around this issue.
>
> Actually, in my situation, the proxy server will unconditionally set a
> Host: header before sending the request to the lighttpd backend.  Header
> rewriting/injection is a common feature in HTTP aware proxies.


Ok, so if we assume that the "Host" header is only missing if the
client didn't specify it and there's no proxy involved, using
SERVER_NAME/SERVER_PORT as a fallback should be ok.

Thanks for the patch and explanation.

--
lh

      reply	other threads:[~2008-09-02  7:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  6:30 [cgit PATCH] use Host: header to generate cgit_hosturl Eric Wong
2008-09-01 20:36 ` Lars Hjemli
2008-09-01 23:07   ` Eric Wong
2008-09-01 23:14     ` Lars Hjemli
2008-09-01 23:30       ` Eric Wong
2008-09-02  7:24         ` Lars Hjemli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c5c35580809020024x564e8bc3o410cea6d4cd905@mail.gmail.com \
    --to=hjemli@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).