Skip to content

Browsers compatibility issues: Files with [ ] or ( ) in the name do have incorrectly encoded hyperlink in "raw" link. #1375

@TomaszSzt

Description

@TomaszSzt

Steps to reproduce
1.Create a repository
2.Push a file named like, for an example "Px-[My file title].txt"
3.Enter the GITBlit page with this file, regardless if through commit or through the tree.
4.Find a "Raw" link to that file. Observe it will be looking like:
../../raw/somethi.git/9533e7971509d8476a9845d8fc31707abee9248c/Px-[My file title].tx

Notice that all un-allowed URL characters are NOT escaped. This includes spaces and [ ] brackets.
Click it in Firefox or Edge.
Observe Server Error.
Notice that browsers DID escape correctly spaces but DID NOT escape brackets. I think they should, but they did not.

5.Manually escape all characters using %20 for space %5A for [ and %5D for ] in browser address bar and tap enter.
6.Observe that server correctly responds to that link.

Wokaround

The only workaround to get raw file with such content through web interface is to download zipped repository.

Recomendation

All hyperlinks generated by GITBLIT should be valid, correctly escaped URLs.

Best regards,
Tomasz Sztejka

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions