Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-04-06 19:01:55 +0000
committerslewis2009-04-06 19:01:55 +0000
commitd02d90151ec28bbbdc1f8a57d28d1a958c58d6d3 (patch)
tree45eee4af965f9c430415bce7d4551236f3241c4e /providers
parentea547c9b4ad823ad6fdb2a6460b9e99080ec3b3f (diff)
downloadorg.eclipse.ecf-d02d90151ec28bbbdc1f8a57d28d1a958c58d6d3.tar.gz
org.eclipse.ecf-d02d90151ec28bbbdc1f8a57d28d1a958c58d6d3.tar.xz
org.eclipse.ecf-d02d90151ec28bbbdc1f8a57d28d1a958c58d6d3.zip
Applied second patch from 270749 for more/better documentation.v20090406-1206
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
index 073685f4b..dda3f79a9 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
@@ -167,7 +167,7 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
return hostConfiguration;
}
- // drops the scheme and port including the colon (e.g http://server:8080/a/b.html -> //server/a/b.html
+ // drops the scheme server and port (e.g http://server:8080/a/b.html -> /a/b.html
private static String getTargetRelativePathFromURL(String url) {
// RFC 3986
/*
@@ -189,9 +189,9 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
*/
// This routine is supposed to remove authority information from the url
// to make this a 'relative path' for
- // HttpClients method constructor (for example GetMethod(String uri))
- //
- // host (not sure this is proper terminology)
+ // HttpClients method constructor (for example GetMethod(String uri)) as
+ // ECF executes methods passing in a HostConfiguration which represents the
+ // authority.
final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$
if (colonSlashSlash < 0)
return url;
@@ -204,17 +204,13 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
return ""; //$NON-NLS-1$
}
String relativeURL = url.substring(nextSlash); // include the slash
- // For multiple consecutive slashes after the authority
- // HttpClient is not working correctly (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=269091)
- /* For example:
- http://eclipse.saplabs.bg//eclipse///updates...
- results in
- //eclipse///updates...
- but HttpClient removes the host in this case:
- ///updates ...
- */
+ // This is a workaround for multiple consecutive slashes after the authority.
+ // HttpClient will parse this as another authority instead of using
+ // it as a path. In anticipation we add "//example.com" so that this will
+ // be removed instead of the first path segment.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=270749#c28
+ // for a full explanation
if (relativeURL.startsWith("//")) { //$NON-NLS-1$
- // In anticipation a host is added back in:
final String host = "example.com"; //$NON-NLS-1$
relativeURL = "//" + host + relativeURL; //$NON-NLS-1$

Back to the top