"GOT", but the "O" is a cute, smiling sun Index | Thread

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotwebd: use SCRIPT_NAME to derive URLs
To:
Omar Polo <op@omarpolo.com>, gameoftrees@openbsd.org
Date:
Tue, 30 Aug 2022 17:07:23 +0200

Download raw body.

On Tue, Aug 30, 2022 at 05:04:26PM +0200, Stefan Sperling wrote:
> On Tue, Aug 30, 2022 at 02:55:41PM +0200, Omar Polo wrote:
> > gotwebd uses DOCUMENT_ROOT as a base for the URLs, but i think this is
> > a bit counter-intuitive.
> > 
> > DOCUMENT_ROOT is meant to be a *physical* path, while to generate URLs
> > we need to look at how things are exposed.  In short, I think it
> > should use SCRIPT_NAME (which httpd.conf(5) documents as "the virtual
> > URI path to the script") as base for the URLs generation.
> > 
> > This allows to remove the extra `root "/"' that we currently need in
> > the gotwebd location and, as a bonus, allows to have gotwebd served on
> > a path different from "/" too!
> 
> Great, thanks a lot for figuring this out! ok stsp

Hmm, on a closer look this probably still needs some adjustments.
I noticed some links in the generated pages are incorrect.

For example, if I view a repository under a link like this:
http://localhost/gotwebd-unix/?index_page=&path=diff.git&action=summary
the links in the "Repos / diff.git / summary" bar at the top lack
the "gotwebd-unix" part and lead into 404:
http://localhost/?index_page=0&path=diff.git&action=summary