summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/servlet/RawServlet.java
Commit message (Collapse)AuthorAgeFilesLines
* raw: URL encode the links to raw view of filesFlorian Zschocke2021-10-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | So far links to raw view were not encoded. The browser did some encoding of spaces on its own, which the servlet would unescape, since it uses the `HttpServletRequest.getPathInfo` method. That decodes the path before returning it. A problem arises when a bracket is in the file (or folder) name. The brackets are the characters that are not allowed in the path, according to the `URI.parse` method. (Which is a bit harsh, because brackets actually are only reserved for the host part since IPv6.) That means that the decoding fails when a bracket character is encountered. This went unnoticed since the failed decoding will return the path as it got it. But once there is a space in the file name, which the browser helpfully encoded for us, the failed decoding will now leave the encoded space in there. And that will result in a path that does not exist, e.g. `file%20[a]`. To be on the safe side, we simply encode the path in the links that we generate, so that it complies with the rules that are used in `getPathInfo`. This fixes #1375.
* raw: Fix raw links to branches with a slash in their nameFlorian Zschocke2020-11-101-6/+11
| | | | | | | | | When a branch has a slash in the name, the raw servlet was not able to find the path under that branch. This is due to the replacement of the forward slash character for URLs. It was not taken into account when comparing the branch name later. This fixes #1290 and its duplicates #1234 and #813.
* raw: Fix getPath with trailing slash that was escapedFlorian Zschocke2020-11-101-3/+7
| | | | | | | | | While this may be an unlikely scenario, let's still prevent this. When a link was created for a path that ends in a trailing slash, that trailing slash would be replaced with the `forwardSlashCharacter`. But in getPath that final slash would be transformed back *after* the check to chop off trailing slashes. This is now switched so that such a trailing slash is also chopped off.
* raw: Fix getPath with lead-ins or missing trailing slashes after the branch.Florian Zschocke2020-11-091-1/+14
|
* raw: Refactor RawServlet:getBranch and :getPath parametersFlorian Zschocke2020-11-091-12/+38
| | | | | | | | | | | Refactor the `getBranch` and `getPath` methods to take a String as second parameter, which is the already sanitised path info. Don't get the path info from a passed in request anymore. The methods are only ever called from within `processRequest`, which already does some checks on the path info, like removing a leading slash character. So no need to do that every time again the methods and passing a request for that.
* raw: Fix exceptions when no path info is given to raw servletFlorian Zschocke2020-11-091-1/+4
|
* raw: Strip leading and trailing slash from repo and path names for linkFlorian Zschocke2020-11-091-0/+9
| | | | | | When creating a link for raw display, a trailing slash is stripped from the end of the base URL. Also do this for the repository, as well as stripping leading slashes from the repository and the path values.
* Fix for #976 - Filestore links via browserPaul Martin2015-12-251-1/+1
| | | | | | | | | | | | | + GitLFS client support + FilestoreModel now parses meta file + Read meta heading from cache if available + Authentication based on accept headers for browser view filestore login + PathModel & PathChangeModel now understands filestore items + Zip & Rar downloads contain include filestore items + Filestore servlet returns LFS JSON error only if accepted by client + DiffStat now knows repository to allow identification of filestore items + Filestore items identified and returned via view, raw & blob links on blame, commitDiff, commit and Tree pages
* revise logic for forcing dotfile to textJoel Johnson2015-12-091-1/+8
|
* Raw servlet now assumes text/plain for dot filesJames Moger2015-11-231-1/+1
|
* Match longest repository path towards the shortest pr-950paladox2015-11-231-15/+6
| | | | This was originally from https://github.com/gitblit/gitblit/pull/950 but seems to have been reverted when develop branch was merged with master.
* Bump to JGit 4.0.0Luca Milanesio2015-06-121-1/+1
| | | | | JGit 4.0.0 fixes a memory leak but introduces a non-compatible change for closing the RevWalk: before it was release() but now is close()
* Fix html raw content type servingJames Moger2015-05-221-9/+18
|
* Ensure that pretty-printed files are served as text/plain in Raw servletJames Moger2014-11-241-3/+12
|
* Add support for image/svg+xml content type to raw servletJames Moger2014-11-191-3/+10
|
* Merge branch 'ticket/211' into developJames Moger2014-10-261-3/+2
|\
| * Fix raw servlet trashing paths with spacesJames Moger2014-10-261-3/+2
| |
* | Merge branch 'ticket/203' into developJames Moger2014-10-071-1/+1
|\|
| * Bug in the rawservlet in extracting the repository out of the path. TheRobbert Noordzij2014-10-071-1/+1
| | | | | | | | | | offset for finding the next slash should be the current slash + 1, not the last offset + the offset of the current slash.
* | Merge branch 'ticket/163' into developJames Moger2014-09-051-4/+1
|\|
| * Fix NPE in raw servlet for long project namesJames Moger2014-09-051-4/+1
| |
* | Merge branch 'ticket/154' into developJames Moger2014-09-041-34/+40
|\|
| * Fix raw serving of files/directories that do not exist in a branch/refJames Moger2014-09-041-34/+40
| |
* | Merge branch 'ticket/148' into developJames Moger2014-09-041-7/+3
|\|
| * Do not stamp raw servlet responses with cache-control headersJames Moger2014-09-041-7/+3
| |
| * Merge branch 'ticket/139'James Moger2014-07-051-5/+2
| |\ | | | | | | | | | | | | Conflicts: src/main/java/com/gitblit/servlet/RawServlet.java
| * \ Merged #139 "Raw link blob paths do not respect web.forwardSlashCharacter"James Moger2014-07-051-5/+6
| |\ \
| * \ \ Merged #137 "NPE in RawServlet#L265"James Moger2014-07-051-0/+9
| |\ \ \
* | \ \ \ Merge branch 'ticket/139' into developJames Moger2014-07-051-5/+2
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | Conflicts: src/main/java/com/gitblit/servlet/RawServlet.java
| * | | | Fix raw servlet blob paths not respecting web.forwardSlashCharacterJames Moger2014-07-051-10/+8
| | | | |
* | | | | Merge branch 'ticket/139' into developJames Moger2014-07-051-5/+6
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Fix raw servlet blob paths not respecting web.forwardSlashCharacterJames Moger2014-07-051-5/+6
| |/ / /
* | | | Merge branch 'ticket/137' into developJames Moger2014-07-051-0/+9
|\ \ \ \ | | |_|/ | |/| |
| * | | Fix possible NPE in RawServletJames Moger2014-07-051-0/+9
| |/ /
* | | Use Guice annotations, not javax.inject annotationsJames Moger2014-07-031-2/+2
| | |
* | | Embrace @Inject for Managers, Servlets, and FiltersJames Moger2014-07-031-10/+14
| |/ |/|
* | Use consistent keys for repository cache lookupsJames Moger2014-06-271-0/+3
|/
* Add raw links to branchesJames Moger2014-05-051-2/+13
|
* Replace RawPage with RawServletJames Moger2014-05-051-0/+472