Bug 2023 - hgwebdir with subdirectories fails to give 404 for invalid URL
Summary: hgwebdir with subdirectories fails to give 404 for invalid URL
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 13:27 UTC by Greg Ward
Modified: 2012-05-13 04:52 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Ward 2010-02-04 13:27 UTC
I have hgwebdir setup with some repos in a subdirectory.  That is,
http://server/hg serves /src/hg, which looks like

  /src/hg/repo1
         /repo2
         /subdir/repo3a
                /repo3b

(Rationale: repo3a and repo3b are different repos of the same project,
whereas repo1 and repo2 are independent projects.)

If you request http://server/hg/bogus, it's fine: hgweb returns a 404 with
"Mercurial repository not found" in the body.  Good.

But if you request http://server/subdir/bogus, you get the index page for
all repos under /src/hg/subdir, the same as when you request
http://server/subdir/.  IMHO this is wrong: it should return a 404 error page.
Comment 1 Dirkjan Ochtman 2010-02-05 07:50 UTC
What version on the server? I thought tonfa had fixed this at some point.
Comment 2 Greg Ward 2010-02-05 08:52 UTC
Server is running not-quite-1.4.3 (25e572394f5c, stable on 2010-01-19) with
a few minor backports from main.  I'll update to 1.4.3 and see if that helps.
Comment 3 Dirkjan Ochtman 2010-02-05 10:37 UTC
No, that's long past the window. I think this is issue1322 (or like it, at
least). I didn't particularly like the fix we have for that. Time to revisit?
Comment 4 Benoît Allard 2010-02-08 05:55 UTC
issue1322 solved the part relative to hg commands, not the browsing one,
such that hg clone http://server/hg/subdir/bogus will get you a 404.

I've been thinking for some time about a way to handle URLs a la Django,
with an URL list and callbacks functions. I've never been further than just
thinking about it though. I guess that would solve all those kind of trouble
we have related to URL handling ...
Comment 5 HG Bot 2010-12-01 19:00 UTC
Fixed by http://selenic.com/repo/hg/rev/86888ae9ce90
Wagner Bruna <wbruna@softwareexpress.com.br>
hgwebdir: fix incorrect index generation for invalid paths (issue2023)

(please test the fix)
Comment 6 Bugzilla 2012-05-12 09:06 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:06 EDT  ---

This bug was previously known as _bug_ 2023 at http://mercurial.selenic.com/bts/issue2023