Originally reported on Google Code with ID 478
What steps will reproduce the problem?
1. Navigate to the "new repository" page
2. In the "name" field put areallylongprojectname/repo.git
3. Check the "Include a README" checkbox.
4. Click [Create]
5. Navigate to the "tree" tab on the newly created repositories page.
6. Click the "raw" link next to the README.md file.
What is the expected output? What do you see instead?
Expected output was to see the raw README.md file
Actual output:
HTTP ERROR 500
Problem accessing /raw/areallylongprojectname/repo.git/master/README.md. Reason:
Server Error
Caused by:
java.lang.NullPointerException
at com.gitblit.servlet.RawServlet.processRequest(RawServlet.java:387)
at com.gitblit.servlet.RawServlet.doGet(RawServlet.java:481)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1651)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:294)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
at com.gitblit.servlet.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:87)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
at com.gitblit.servlet.AccessRestrictionFilter.doFilter(AccessRestrictionFilter.java:243)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1639)
at com.gitblit.servlet.ProxyFilter$1.doFilter(ProxyFilter.java:74)
at com.gitblit.servlet.ProxyFilter.doFilter(ProxyFilter.java:67)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1631)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:462)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)
What version of the product are you using? On what operating system?
GitBlit Version 1.6.0
Please provide any additional information below.
There is a bug in the RawServlet when parsing the repository path out of the url. If
the project name is longer than the repository name it will fail to find the repository
path because it adds the index of the first / twice when trying to parse out the repository
path.
Fix to bug.
Just need to increment offset by 1 to exclude the character whose index was just returned.
Please find attached patch that fixes this issue.
Reported by robertmrobersonjr on 2014-08-01 14:15:29
- _Attachment: [rawservlet.patch](https://storage.googleapis.com/google-code-attachments/gitblit/issue-478/comment-0/rawservlet.patch)_
Originally reported on Google Code with ID 478
Reported by
robertmrobersonjron 2014-08-01 14:15:29- _Attachment: [rawservlet.patch](https://storage.googleapis.com/google-code-attachments/gitblit/issue-478/comment-0/rawservlet.patch)_