koolking12 / hudson-eclipse

Automatically exported from code.google.com/p/hudson-eclipse
0 stars 0 forks source link

Invalid URL with tomcat #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Just configure the URL to some hudson server hosted by tomcat
2. Get an invalid URL message

What is the expected output? What do you see instead?
Correct URL

What version of the product are you using? On what operating system?
Hudson-eclipse 1.0.3

Please provide any additional information below.
Tomcat version: 5.5.23
Hudson version: 1.143

The URL I use is really simple, something like: http://myserver/hudson.
After some investigations, I found that the error comes from a tomcat 
'invalid request' message.

If I type the URL as: http://myserver//hudson (notice the double '/'), the
Hudson view works, but not the links(opened internally in eclipse).

I modified the source and replaced the getRelativePath method in HudsonClient.
See the diff below.

I just keeps the first '/' character from the entered URL, that way, URL are 
always got as absolute.

It is a quick modification, and I do not know if it works in all cases.

-------------------------------------------------------------------------------

--- /home/olivier/data/temp/HudsonClient.java   2007-10-17 00:25:56.000000000
+0200
+++ HudsonClient.java   2007-10-30 11:29:07.325851900 +0100
@@ -189,9 +189,9 @@
    private String getRelativePath(String url) {
        int pos = url.indexOf('/', 8);
        if (pos == -1) {
-           return "";
+           return "/";
        } else {
-           return url.substring(pos + 1);
+           return url.substring(pos);
        }
    }
 }

Original issue reported on code.google.com by oli.sa...@gmail.com on 30 Oct 2007 at 12:03

GoogleCodeExporter commented 8 years ago
I just added the patch as a file (it seems my copy/paste was a bit erroneous)

Original comment by oli.sa...@gmail.com on 30 Oct 2007 at 12:05

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, this will be fixed in the next release.

Original comment by jre...@gmail.com on 3 Nov 2007 at 3:15

GoogleCodeExporter commented 8 years ago
Fixed in 1.0.4

Original comment by jre...@gmail.com on 4 Mar 2008 at 6:10