[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

Rural Hunter

[bugs:#1882] Url encoding problem with '%u'

Status: open
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Fri May 12, 2017 02:44 AM UTC
Owner: nobody

This url: <a href="http://editor.caacnews.com.cn:81/search?channelid=12168&amp;searchword=%u65E5%u671F=2017.04.24" rel="nofollow">http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:
http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

Ahmed Ashour-3
  • Description has changed:

Diff:

--- old
+++ new
@@ -1,6 +1,11 @@
-This url: http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001
+This url:
+~~~
+http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001
+~~~

 In htmlunit with firefox browser version, the url is encoded to this:
+~~~
 http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001
+~~~

 The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.

[bugs:#1882] Url encoding problem with '%u'

Status: open
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Fri May 12, 2017 02:44 AM UTC
Owner: nobody

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

Ahmed Ashour-3
In reply to this post by Rural Hunter
  • status: open --> accepted
  • assigned_to: Ahmed Ashour

[bugs:#1882] Url encoding problem with '%u'

Status: accepted
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Sat Jun 03, 2017 01:45 PM UTC
Owner: Ahmed Ashour

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

HtmlUnit - Dev mailing list
In reply to this post by Rural Hunter

HttpWebConnection4Test.queryString() case was added


[bugs:#1882] Url encoding problem with '%u'

Status: accepted
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Sat Jun 03, 2017 01:59 PM UTC
Owner: Ahmed Ashour

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

HtmlUnit - Dev mailing list
In reply to this post by Rural Hunter
  • assigned_to: Ahmed Ashour --> nobody
  • Comment:

I am afraid it may not be possible, using HttpClient under the hood.

The URL is being transformed to URI, which throws the exception.

The below tiny case with HttpClient shows the error:

    final Logger logger = Logger.getLogger("org.apache.http.headers");
    logger.setLevel(Level.DEBUG);
    final HttpClientBuilder builder = HttpClientBuilder.create();
    CloseableHttpClient client = builder.build();
    HttpUriRequest request = new HttpGet("http://localhost:8080/index2.jsp?para=%u65E5");
    HttpHost host = HttpHost.create("http://localhost:8080");
    client.execute(host, request);

[bugs:#1882] Url encoding problem with '%u'

Status: accepted
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Sun Jun 18, 2017 10:01 AM UTC
Owner: nobody

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

HtmlUnit - Dev mailing list
In reply to this post by Rural Hunter

I found this same issue: https://stackoverflow.com/questions/2280863/uri-encoding-in-unicode-for-apache-httpclient-4


[bugs:#1882] Url encoding problem with '%u'

Status: accepted
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Mon Jun 19, 2017 01:26 PM UTC
Owner: nobody

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] [htmlunit:bugs] #1882 Url encoding problem with '%u'

HtmlUnit - Dev mailing list
In reply to this post by Rural Hunter

I think this can be closed. I worked it around by this:
url=StringEscapeUtils.unescapeJava(url.replace('%', '\'));


[bugs:#1882] Url encoding problem with '%u'

Status: accepted
Group: Latest SVN
Created: Fri May 12, 2017 02:44 AM UTC by Rural Hunter
Last Updated: Fri Jun 23, 2017 04:07 AM UTC
Owner: nobody

This url:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%u65E5%u671F=2017.04.24*%u7248%u6B212=001

In htmlunit with firefox browser version, the url is encoded to this:

http://editor.caacnews.com.cn:81/search?channelid=12168&searchword=%25u65E5%25u671F=2017.04.24*%25u7248%25u6B212=001

The percentage sign is encoded to %25. But I snifferred the network traffic of real browser, the percentage sign is not encoded.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...