Opened 5 years ago

Closed 5 years ago

#1277 closed defect (fixed)

i2p proxy 4444 does not parse url's with | in it

Reported by: rfree Owned by:
Priority: minor Milestone: 0.9.14
Component: apps/i2ptunnel Version: 0.9.12
Keywords: url character escape proxy freenet Cc:
Parent Tickets:

Description

<psi> says it works fine for him BUT he is also said to use privoxy proxy that might be escaping URL or something (also he is on -dev version) I am on 0.9.12-0.

This opens in i2p via proxy 4444 on firefox:

http://freenet3.i2p/SSK@hk7zpFxeTmGBnbVWgFVyZqbTNxqVji4JLJjRhd3W8ZQ,yrjcGiosCvaQ~sL~PYQ4w6o6rT78LEFQYv~4oEvtSKE,AQACAAE/fms

but when I add character "|" to end then it fails to work:

freenet3.i2p/SSK@hk7zpFxeTmGBnbVWgFVyZqbTNxqVji4JLJjRhd3W8ZQ,yrjcGiosCvaQ~sL~PYQ4w6o6rT78LEFQYv~4oEvtSKE,AQACAAE/fms|

it shows me for a second the i2p router page (like in case of DNS lookup thing) saying that the URL is invalid.

Sometimes I am redirected (by firefox?) to www.freenet.i2p page instead,
but other times I am able to see the full error message:

"
Warning: Invalid Request URI
The request URI is invalid, and probably contains illegal characters. If you clicked a link, check the end of the URI for any characters the browser has mistakenly added on.
"

Well, '|' is valid character (I dear hope!)

This is serious problem for some users: it blocks certain gateways and i2p-freenet cooperation.

Subtickets

Change History (6)

comment:1 Changed 5 years ago by str4d

RFC 3986 does not include | as a valid URL character (see this StackOverflow answer), so it must be escaped. This is therefore not a direct problem with I2P.

Whether it is worth mitigating is another question. The copy-pasted URL fails in Firefox for me, but I think the onus for escaping the | usually falls on the web server that generates the HTML containing the link.

comment:2 Changed 5 years ago by zzz

  • Milestone changed from 0.9.13 to 0.9.14
  • Priority changed from major to minor

Not a bug. Don't "hope" the character is valid - check the specs.

Sample stack trace:

WARN  [t Runner 173] .i2ptunnel.I2PTunnelHTTPClient: Client[1/346]: Bad request [http://trac.i2p2.i2p/ticket/1277||]
java.net.URISyntaxException: Illegal character in path at index 32: http://trac.i2p2.i2p/ticket/1277||
	at java.net.URI$Parser.fail(URI.java:2816)
	at java.net.URI$Parser.checkChars(URI.java:2989)
	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
	at java.net.URI$Parser.parse(URI.java:3021)
	at java.net.URI.<init>(URI.java:578)
	at net.i2p.i2ptunnel.I2PTunnelHTTPClient.clientConnectionRun(I2PTunnelHTTPClient.java:441)
	at net.i2p.i2ptunnel.I2PTunnelClientBase$BlockingRunner.run(I2PTunnelClientBase.java:723)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)

The only issue here is that we're closing the connection too quickly, or not flushing, or something, so the error page isn't displayed for long and is replaced with the 'connection reset' message in firefox.

So let's leave the ticket open to fix that.

comment:3 Changed 5 years ago by killyourtv

If you properly escape the entities, it'll work, e.g. http://freenet3.i2p/SSK@hk7zpFxeTmGBnbVWgFVyZqbTNxqVji4JLJjRhd3W8ZQ,yrjcGiosCvaQ~sL~PYQ4w6o6rT78LEFQYv~4oEvtSKE,AQACAAE/fms%7C2014-05-14%7CMessage-0?type=text/plain

Indeed, this is not a bug in I2P, but there there are bugs in Freenet and FMS.

comment:4 Changed 5 years ago by killyourtv

Cancel that, it might be in Firefox. When using curl to retrieve the source, the URIs are encoded.

(Regardless, it's not an I2P bug but it did help to find one)

comment:5 Changed 5 years ago by zzz

  • Status changed from new to testing

re: connection reset message

Tried a bunch of things, delays, flushing, closing only the output, etc. The only thing that worked was reading the rest of the header lines before closing.

Fixed in 06a3ec94512b074ae164177d97b2afd916bbdf3c i2p.i2p.zzz.test2 to be propped for 0.9.14.

comment:6 Changed 5 years ago by killyourtv

  • Resolution set to fixed
  • Status changed from testing to closed

Looks good in 0.9.14.1.

Note: See TracTickets for help on using tickets.