davideuler / gitblit

Automatically exported from code.google.com/p/gitblit
Apache License 2.0
0 stars 0 forks source link

Raw servlet, %2F, and Tomcat #479

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Actually there are two problems here. I have a project with generated jsdoc 
task that create html documentation.
When opening the generated html file in raw view, I get a blank page, and the 
response status is 400 Bad Request.

The link contains %2F before the html file, instead of /.
If I change the url to use / instead, then I get the html but I get it as 
text/plain, instead of text/html, and ofcourse it doesn't appear as an html 
document, nor does it sends requests for other resources (css etc.).

What steps will reproduce the problem?
1. commit to gitblit an html document
2. open the document as RAW
3. Change the %2F to /

What version of the product are you using? On what operating system?
I use version 1.6.0 running on apaches tomcat. No proxy in the middle.

Thanks,
Lior

Original issue reported on code.google.com by liorch...@gmail.com on 3 Aug 2014 at 7:57

GoogleCodeExporter commented 9 years ago
I understand your expectation for the text/html content type.  Gitblit does 
support serving content like a web-server, but it only does so from the 
"gh-pages" branch.  This is the same design as GitHub. See the following 
examples:

github raw: https://github.com/gitblit/gitblit/raw/gh-pages/administration.html
github served: http://gitblit.github.io/gitblit/administration.html

gitblit raw: 
https://dev.gitblit.com/raw/gitblit.git/gh-pages/administration.html
gitblit served: https://dev.gitblit.com/pages/gitblit.git/administration.html

Raw is text/plain for known text files.  Served is text/html.

There are some glitches with the raw servlet which need to be addressed - like 
your %2F issue with Tomcat.  But setting the text/html content type is not one 
that I plan to address.

Original comment by James.Mo...@gmail.com on 12 Aug 2014 at 6:27

GoogleCodeExporter commented 9 years ago
That's fixed in current master, isn't it? I have that issue with 1.6.0, but not 
with a custom built now. The paths are now outputted with / instead of %2F.

Original comment by stef...@steffen-gebert.de on 5 Sep 2014 at 1:16

GoogleCodeExporter commented 9 years ago
It's unclear.  The OP didn't include example urls.  Are you running GO or WAR ?

Original comment by James.Mo...@gmail.com on 5 Sep 2014 at 1:20

GoogleCodeExporter commented 9 years ago
I'm using the WAR. It's only #478 that breaks some repos. For the rest, raw 
viewing works now. 

Original comment by stef...@steffen-gebert.de on 5 Sep 2014 at 1:57

GoogleCodeExporter commented 9 years ago
Um.. I'm puzzled now. I have to revisit that topic again next week. After 
switching back from a build including #478 (which replaces the / with ! I 
think), the build of current master is still working, but using also ! as path 
separator.

Are these paths somewhere cached?

Original comment by stef...@steffen-gebert.de on 5 Sep 2014 at 2:12

GoogleCodeExporter commented 9 years ago
I'll push the fix for 478 later today.

Original comment by James.Mo...@gmail.com on 5 Sep 2014 at 2:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is the other one this issue: 
https://code.google.com/p/gitblit/issues/detail?id=478

Original comment by stef...@steffen-gebert.de on 3 Oct 2014 at 6:16

GoogleCodeExporter commented 9 years ago
I was having an issue with 1.6.0, so I built from master (1.6.1-SNAPSHOT 
a9a16b5b), and it didn't fix it.

Most raw links work fine, but I have one repository where one directory (I 
think) all the raw links don't work.  For example:

http://xvci2:8888/gitblit/raw/apps/iv.git/master/src!main!webapp!index.jsp

works, but:
http://xvci2:8888/gitblit/raw/apps/iv.git/master/docs!reportxml-docs!ResReportHe
lp.html

shows:
Error

Sorry, the requested resource docs/reportxml-docs/ResReportHelp.html was not 
found in master.

and in the log:
2014-10-03 12:07:38 [ERROR] RawServlet Failed to load apps/iv.git 
ef48adf1ade477eb21873c1756efeabb1f88da9d 
apps/iv.git/master/docs!reportxml-docs!ResReportHelp.html

1.6.0 had a NPE stack trace, just one line in 1.6.1-SNAPSHOT

I'm running the war file in tomcat 7.0.52

Is this the same defect, or another one?

Original comment by manith...@gmail.com on 3 Oct 2014 at 6:53

GoogleCodeExporter commented 9 years ago
Sounds like the same.  Can you share the repo?

Original comment by James.Mo...@gmail.com on 6 Oct 2014 at 6:14

GoogleCodeExporter commented 9 years ago
No, I cannot share the repo.  I can spend a reasonable amount of time 
building/patching, trying to narrow down the cause, but the source in the 
repository is proprietary and confidential :-(.

If there's anything I could try (I haven't dug into the source of gitblit 
before), please let me know.

Original comment by manith...@gmail.com on 6 Oct 2014 at 10:22

GoogleCodeExporter commented 9 years ago
v1.6.1 released

Original comment by James.Mo...@gmail.com on 20 Oct 2014 at 9:36

GoogleCodeExporter commented 9 years ago
I still get the same error in v1.6.1

Original comment by manith...@gmail.com on 24 Oct 2014 at 6:00

GoogleCodeExporter commented 9 years ago
Pull requests welcome.

Original comment by James.Mo...@gmail.com on 24 Oct 2014 at 6:01