Code Monkey home page Code Monkey logo

Comments (17)

gitblit avatar gitblit commented on July 30, 2024
For now set this property in gitblit.properties:

web.mountParameters=false

Reported by James.Moger on 2011-10-10 12:05:02

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
I'd like you to do 2 things for me:

1. Using your browser, inspect the link that you click to generate this error and paste
the <a> tag on this issue.

2. Tell me what browser you are using.  I think you said you were running latest Ubuntu.

This issue has come up before and it has to do with forward slashes and how they are
encoded/decoded by Wicket but I can not completely eliminate the browser from the equation
either.

Using parameterized urls instead of mounted urls (web.mountParameters=false) solves
your immediate problem.

Reported by James.Moger on 2011-10-10 12:50:47

  • Status changed: Accepted

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
The link from the address bar is 

  http://192.168.41.84/gitblit/log/gitblit-crowd.git/refs%2Fheads%2Fmaster

The generated HTML is:

  <a href="../log/gitblit-crowd.git/refs%2Fheads%2Fmaster" class="list name"><span>master</span></a>

Note that I'm using this behind mod_proxy so a local httpd is accessing this as http://127.0.0.1:8445/gitblit.
To get this far I also needed another patch, see this commit in my repository: https://github.com/trygvis/gitblit/commit/3ab5b06fa234c7ee802757562355d39976a811fa.
Sorry for not noting that in the first issue.

Reported by trygvis on 2011-10-10 13:39:57

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
The reason the request fails is because the request is formatted as:
   gitblit-crowd.git/refs/heads/master
instead of:
   gitblit-crowd.git/refs%2Fheads%2Fmaster

Wicket splits the request by '/' which results in the wrong number of parameters, 4
-- first request format -- instead of 2.

Workarounds/solutions:
1. Fix: Don't mount urls (web.mountParameters = false)
2. Fix/Hack: Don't use '/' within a parameter (web.forwardSlashCharacter = !)
3. mod_proxy allowEncodedSlashes
http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes

I'm interested in knowing the results of #3.  I think you want the NoDecode option.

I'd also like to know more about the context path change.  Mod proxy would not proxy
to the root of GO?

Reported by James.Moger on 2011-10-10 14:25:52

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
I can try the mod_proxy fixes at work tomorror. web.mountParameters = false works around
the problem, but I do like the pretty URLs.

I've used urlrewritefilter [1] with luck previously to support pretty URLs. I haven't
ever used wicket so I don't know if Wicket has something better built in.

The reason for the context path change is because I'm using plain rewriting and not
mod_ajp. I want gitblit to be exposed as http://host/gitblit and to get gitblit to
have sane URLs it needed to be deployed under the same context. If didn't it would
create urls that pointed to http://host/git/gitblit-crowd.git (note the missing /gitblit).

[1]: http://code.google.com/p/urlrewritefilter/?

Reported by trygvis on 2011-10-10 18:49:18

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
So.... hows it going?

Reported by James.Moger on 2011-10-12 11:54:51

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
NoDecode is not available until 2.2.18 and Ubuntu only has 2.2.17.

As a side note, adding "ProxyPreserveHost On" had the nice effect of fixing the git
clone URLs.

Reported by trygvis on 2011-10-12 14:14:15

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
I just realized that Ubuntu is releasing 11.10 today so I might get to try this out
quite soon after all.

Reported by trygvis on 2011-10-13 10:06:55

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
So how is the url rewriting going?

Reported by James.Moger on 2011-11-08 20:21:00

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
I'm getting URLs like this:

  http://192.168.41.84/gitblit/blobdiff/gitblit-crowd.git/9b72a2e674f7cbc320b0b72fc71ad813d296ab12/src%2Fcom%2Fgitblit%2FLauncher.java

which hits the wicket code (after I set "AllowEncodedSlashes NoDecode").

However there's no content on the page, and the path shown in the display is "[gitblit-crowd.git]
/ src%2Fcom%2Fgitblit%2FLauncher.java" which leads me to think that the wicket code
is not decoding the request properly.

Reported by trygvis on 2011-11-09 08:49:06

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
Hmmm.  Clearly something is not working quite right - the displayed path should be what
you expect, not the %2F encoded value.

Your url is properly formatted and I confirm that it works here (after switching repo
names).  Is this the url you get after rewrite and that url is sent to Gitblit?  Is
it possible that the url is being double encoded?  I've seen that happen to; something
like src%202Fcom%202Fgitblit%202FLauncher.java

Reported by James.Moger on 2011-11-09 13:14:42

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
While I prefer to fix this by making sure that the url getting to Gitblit is 100% correct,
I think we can try a workaround too.

There are a few page parameters that may have embedded forward slashes:
  r (repository parameter)
  h (object id or ref)
  f (path parameter)

Each of those parameters is retrieved from the Wicket PageParameters object by a static
function call in com.gitblit.wicket.WicketUtils.  i.e. getRepository, getObject, getPath.
 You could hack these methods to replace("%2F", "/") and report back how that works
for you.

I'm overdue on a new release by ~ 2 weeks.  I plan to release this week.  And then
again in late December or early January with JGit 1.2 amongst other things.

Reported by James.Moger on 2011-11-09 15:20:27

from gitblit.

gitblit avatar gitblit commented on July 30, 2024
This was fixed in v0.7.0 and/or worked-around by using one of the URL control settings.

Reported by James.Moger on 2012-01-11 21:47:07

  • Status changed: Fixed
  • Labels added: Milestone-0.7.0

from gitblit.

steveno avatar steveno commented on July 30, 2024

Should this issue be closed?

from gitblit.

gitblit avatar gitblit commented on July 30, 2024

Hmm. Looks like the GoogleCode import didn't close all issues correctly. Doh!

from gitblit.

steveno avatar steveno commented on July 30, 2024

👍

In that case you should close #314 and #310 too.

from gitblit.

gitblit avatar gitblit commented on July 30, 2024

Thanks. Done.

from gitblit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.