-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browsers compatibility issues: Files with [ ] or ( ) in the name do have incorrectly encoded hyperlink in "raw" link. #1375
Comments
While I agree that the brackets could be escaped, I cannot reproduce an error. Which exact environment (OS/Browser) did you use? I tested this under macOS with Firefox 92.0.1, Chrome 94.0.4606.81 and Safari 14 as well as under Linux with Firefox 93.0 and Chrome 94.0.4606.71. I never got en error but was always able to see the raw file. |
Sorry for a delay, I was not monitoring this issue for a while. I can still reproduce it every time and on every machine I checked at my work-place. It doesn't mean much because we were running a mass upgrade recently and all machines are fairly identical, but it shows that it is not a single seat configuration problem. Windows 10, Firefox 93.0, GitBlit 1.8.0. No Firefox extensions were installed at the moment when the bug was encountered for a first time. Sever page scree-shot: The html snippet for this link:
You will notice, that the raw link is NOT escaped at all, while blame and history links ARE escaped. Server response: Error The same problem can be reproduced in Edge 94.0.992.50 I did NOT test it with Gitblit 1.9.0 because I could not find any mention about this kind of a problem in a change log and updating a server is a risk I would like to avoid. |
Yes, the raw link is not escaped, I just could not reproduce this problem, as the browsers do not mind. I will try this under Windows 10. |
Interestingly, this seems to only occur with files that have a combination of spaces and brackets in the name. I was able to reproduce it with the exact filename of yours. A file with just brackets or just spaces does not pose a problem. |
Ha! I never tested another combination. Good to know that. |
This seems to happen when both spaces and brackets are in a file name. I could not find a specific pattern or combination. |
I take it you use Gitblit GO? I have fixed this in PR #1383 but would still have to check how this behaves in an application server and if anything breaks. |
Thanks for fix, now I will have a good reason to update when the next release will be officially ready, tested and stable. |
Ya, well, I can give you officially ready, I don't know about tested and stable. I wish I had a way to release thoroughly tested builds, but as things are right now, I don't have the resources for that. And I have no idea how many people still use Gitblit, so how much testing it gets in the field. I do try to keep it as stable as possible. |
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
The text was updated successfully, but these errors were encountered: