git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [cgit PATCH] use Host: header to generate cgit_hosturl

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 1, 2008, 23:30 UTC
Message-ID
<20080901233033.GB19984@hand.yhbt.net>
In-Reply-To
<8c5c35580809011614k6ec5a0e9tdfd5d3031c58b84@mail.gmail.com>
Lars Hjemli <hjemli@gmail.com> wrote:
Show 17 quoted lines
> 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.
-- 
Eric Wong
Previous: Lars HjemliNext: Lars Hjemli
Message 5 of 6 in “use Host: header to generate cgit_hosturl”
  1. use Host: header to generate cgit_hosturlEric Wong, Sep 1, 2008
  2. Lars HjemliSep 1, 2008
  3. Eric WongSep 1, 2008
  4. Lars HjemliSep 1, 2008
  5. Eric WongSep 1, 2008
  6. Lars HjemliSep 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.