List for cgit developers and users
 help / color / mirror / Atom feed
From: demelier.david at gmail.com (David Demelier)
Subject: Troubles using special characters in links with lighttpd
Date: Fri, 15 May 2015 15:12:53 +0200	[thread overview]
Message-ID: <1431695573.7047.2.camel@gmail.com> (raw)
In-Reply-To: <20150515123910.GE10518@serenity.lan>

On Fri, 2015-05-15 at 13:39 +0100, John Keeping wrote:
> On Fri, May 15, 2015 at 01:24:29PM +0100, John Keeping wrote:
> 
> 	<a href="/code/tree/C%20%20">C  </a>
> 
> So I think what's happening is that you rewrite the URL from:
> 
> 	/code/tree/C++
> 
> to:
> 
> 	/cgit.cgi?url=code/tree/C++
> 
> but now the path is in the query part not the path part and the escaping
> rules are different, so "+" translates to " ".
> 

Thanks for your quick answer!

Okay, I understand the problem. I can't remember where do I saw the
usage of url parameter instead.

I've switched to this instead :
$HTTP["host"] == "git.malikania.fr" {
        server.errorlog         =
"/var/log/lighttpd/cgit-error.log"                                                                                                                             
        accesslog.filename      = "/var/log/lighttpd/cgit-access.log"

        server.document-root = "/usr/local/www/cgit"
        cgi.assign = ( ".cgi" => "/usr/local/www/cgit/cgit.cgi" )
        index-file.names     = ( "cgit.cgi" )

        $HTTP["url"] =~ "^/(.*)\.git" {
                url.rewrite-once = (
                        "^(.*)?$" => "/cgit.cgi/$1"
                )
        }
}

I conditionnaly rewrite links only when searching for a directory
starting with .git (so that the cgit.css is not broken).

Works correctly now :-)

Only have to name my repositories with trailing .git though, if you have
an idea how I can improve that.

Thanks!



  reply	other threads:[~2015-05-15 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 12:08 demelier.david
2015-05-15 12:24 ` john
2015-05-15 12:39   ` john
2015-05-15 13:12     ` demelier.david [this message]
2015-05-15 13:32       ` 
2015-05-15 13:34       ` john

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=1431695573.7047.2.camel@gmail.com \
    --to=cgit@lists.zx2c4.com \
    /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).