You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Pavel Sher (JIRA)" <ji...@apache.org> on 2008/09/29 16:12:44 UTC

[jira] Created: (IVY-923) Can't download files containing space or + in their names by HTTP

Can't download files containing space or + in their names by HTTP
-----------------------------------------------------------------

                 Key: IVY-923
                 URL: https://issues.apache.org/jira/browse/IVY-923
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0-RC1
            Reporter: Pavel Sher


I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.

The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Pavel Sher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635432#action_12635432 ] 

Pavel Sher commented on IVY-923:
--------------------------------

I made a quick and dirty hack in HttpClientHandler: in methods doGet, doHead and upload I changed argument url to:
BasicURLHandler.normalize(dest).toExternalForm()

This solved problem with names with spaces but names with plus sign still do not work.


> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maarten Coene updated IVY-923:
------------------------------

    Fix Version/s:     (was: trunk)
                   2.0-RC2

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>            Assignee: Maarten Coene
>             Fix For: 2.0-RC2
>
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635545#action_12635545 ] 

Maarten Coene commented on IVY-923:
-----------------------------------

I agree with you that the space should be escaped, however, if I understand the spec correctly, I don't think the '+' character must be escaped.
Are you sure this is the cause of your problem?

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Pavel Sher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635560#action_12635560 ] 

Pavel Sher commented on IVY-923:
--------------------------------

My problem is that + character is converted to space by servlet container. However I need it to be + otherwise I won't be able to find file. 

I am not sure about RFC, indeed it seems that it does not require + to be encoded. However I also found this document: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm and it says that + character must be encoded if it does not have special meaning in the URL.

BTW Java URLEncoder also treats + as unsafe character and converts it to %2B.

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maarten Coene resolved IVY-923.
-------------------------------

       Resolution: Fixed
    Fix Version/s: trunk
         Assignee: Maarten Coene

I've committed a fix into SVN trunk.
Could you give it a try and please reopen if the problem hasn't been solved.

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>            Assignee: Maarten Coene
>             Fix For: trunk
>
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Pavel Sher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637415#action_12637415 ] 

Pavel Sher commented on IVY-923:
--------------------------------

Just checked it with the latest sources and it works! Thanks again Maarten!

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>            Assignee: Maarten Coene
>             Fix For: trunk
>
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635391#action_12635391 ] 

Maarten Coene commented on IVY-923:
-----------------------------------

Do you have the same problem when not using commons-httpclient?

Maarten

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-923) Can't download files containing space or + in their names by HTTP

Posted by "Pavel Sher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635424#action_12635424 ] 

Pavel Sher commented on IVY-923:
--------------------------------

Unfortunately BasicUrlHandler does not support HTTP authentication and it is not so easy to check with another server on my side. 

> Can't download files containing space or + in their names by HTTP
> -----------------------------------------------------------------
>
>                 Key: IVY-923
>                 URL: https://issues.apache.org/jira/browse/IVY-923
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-RC1
>            Reporter: Pavel Sher
>
> I have an artifact with space in it's name, such artifact can't be downloaded by Ivy 2.0 RC1. The problem is somewhere near the doHead() method of the org.apache.ivy.util.url.HttpClientHandler class. This method receives url but this url contains spaces and when HttpClient HeadMethod is constructed an exception is thrown (which is silently ignored by the way). It seems that URL parts must be properly escaped before sent to HTTP client, since URL.toExternalForm() does not do this.
> The same problem seems to occur if file name contains +.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.