git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Tadeusz Sosnierz <tadzikes@gmail.com>,
	Eric Wong <normalperson@yhbt.net>
Subject: Re: [BUGFIX PATCH 1/4] git-instaweb: Fix issue with static files for 'plackup' server
Date: Thu, 30 Dec 2010 01:40:06 +0100	[thread overview]
Message-ID: <201012300140.07843.jnareb@gmail.com> (raw)
In-Reply-To: <7v1v50rvat.fsf@alter.siamese.dyndns.org>

On Thu, 30 Dec 2010, Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > The default (in gitweb/Makefile) is to use relative paths for gitweb
> > static files, e.g. "static/gitweb.css" for GITWEB_CSS.  But the
> > configuration for Plack::Middleware::Static in plackup_conf assumed
> > that static files must be absolute paths starting with "/gitweb/"
> > prefix which had to be stripped, e.g. "/gitweb/static/gitweb.css".
> > This in turn caused web server run by "git instaweb --httpd=plackup"
> > to not access static files (e.g. CSS) correctly.
> >
> > This is a minimal fixup, making 'plackup' web server in git-instaweb
> > work with default gitweb build configuration.
> >
> > Reported-by: Tadeusz Sośnierz <tadzikes@gmail.com>
> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> > ---
> > The regexp is probably too strict: qr{^/static/} should be enough,
> > but I didn't want to change too much at once.
[...]
> > diff --git a/git-instaweb.sh b/git-instaweb.sh
> > index 10fcebb..bb57d81 100755
> > --- a/git-instaweb.sh
> > +++ b/git-instaweb.sh
> > @@ -549,7 +549,7 @@ my \$app = builder {
> >  	};
> >  	# serve static files, i.e. stylesheet, images, script
> >  	enable 'Static',
> > -		path => sub { m!\.(js|css|png)\$! && s!^/gitweb/!! },
> > +		path => qr{^/static/.*(?:js|css|png)\$},
> 
> I wonder if you meant qr{^/static/.*\\.(?:js|css|png)\$} here, to make
> sure that these three tokens are file suffixes, not just random
> substring.

Yes, it should be qr{^/static/.*\\.(?:js|css|png)\$} though as I said:
"The regexp is probably too strict: qr{^/static/} should be enough,"

-- 
Jakub Narebski
Poland

  reply	other threads:[~2010-12-30  0:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 16:43 [PATCH 0/4] git-instaweb: Three fixes and one improvement Jakub Narebski
2010-12-29 16:47 ` [BUGFIX PATCH 1/4] git-instaweb: Fix issue with static files for 'plackup' server Jakub Narebski
2010-12-29 23:24   ` Junio C Hamano
2010-12-29 23:52   ` Junio C Hamano
2010-12-30  0:40     ` Jakub Narebski [this message]
2010-12-29 16:48 ` [PATCH 2/4] git-instaweb: Static files are under "static/" in gitweb_conf Jakub Narebski
2010-12-29 16:49 ` [PATCH 3/4] git-instaweb: Add checks that web server can be started and is started Jakub Narebski
2010-12-29 16:50 ` [PATCH 4/4] git-instaweb: Use "git-instaweb" as sitename (for page titles) Jakub Narebski
2010-12-30  6:23   ` Eric Wong

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=201012300140.07843.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=normalperson@yhbt.net \
    --cc=tadzikes@gmail.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).