Kallithea issues archive

Issue #178: 404 When Clicking on 'Files' for Repository Called 'files'

Reported by: Geert Linders
State: new
Created on: 2015-12-14 00:04
Updated on: 2018-02-21 23:14

Description

If I have a repository called 'files' and click on 'Files' in the repository view, Kallithea responds with a 404 page.

If I rename the repository, for instance, to 'files2' then Kallithea does show me the files inside the repository when clicking on 'Files'.

It seems that Kallithea becomes confused when it tries to parse a URL that contains the name 'files' twice in a row: <repo path>/files/files/tip

Attachments

Comments

Comment by Geert Linders, on 2015-12-14 00:08

Comment by Mads Kiilerich, on 2015-12-22 13:19

Yes, the url naming scheme has collisions. It has issues both with collisions with reserved words and with '/' and other characters in values passed in URLs.

I would like to change the scheme to something like https://kallithea-scm.org/repos/kallithea/~/files/tip/ or some other way to "escape" from the repo name so it unambiguously can be detected. Someone "just" have to come up with a good scheme and implement it in kallithea/config/routing.py ... and preserve the most common old URLs for backwards compatibility.

Comment by Sam Jaques, on 2018-02-21 09:53

We also see the issue for files within a hg changeset having the same name with different capitalization. When clicking on the comment button within the second file diff, it jumps automatically to a comment box within the first file diff, making commenting on the second file impossible.

Comment by Mads Kiilerich, on 2018-02-21 23:14

@sjaques That is a different problem, probably caused by "normalizing" file names when we shouldn't. Easy to fix ... but hard to do in a backwards compatible way that doesn't break all existing links ...

It would be great if you can file a different issue for that.

Comment by Sam Jaques, on 2018-02-22 07:40

Alright, I make it happen. Thanks for the fast reply!