Skip to content
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

RawServlet issue when the project name is longer than the repository name #774

Closed
gitblit opened this issue Aug 12, 2015 · 3 comments
Closed

Comments

@gitblit
Copy link
Owner

@gitblit gitblit commented Aug 12, 2015

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)_
@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Reported by James.Moger on 2014-08-12 18:29:00

  • Status changed: Accepted
  • Labels added: Milestone-1.6.1

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Thanks for the patch!  Fix pushed to master.

Reported by James.Moger on 2014-09-05 16:14:55

  • Status changed: Queued

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

v1.6.1 released

Reported by James.Moger on 2014-10-20 21:36:03

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix added this to the 1.6.1 milestone Dec 13, 2016
@flaix flaix added this to the 1.6.1 milestone Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants