Opened 7 years ago

Closed 7 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: Sensitive: no


<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:


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


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.


Change History (6)

comment:1 Changed 7 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 7 years ago by zzz

Priority: majorminor

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||] Illegal character in path at index 32: http://trac.i2p2.i2p/ticket/1277||
	at net.i2p.i2ptunnel.I2PTunnelHTTPClient.clientConnectionRun(
	at net.i2p.i2ptunnel.I2PTunnelClientBase$
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

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 7 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 7 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 7 years ago by zzz

Status: newtesting

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 7 years ago by killyourtv

Resolution: fixed
Status: testingclosed

Looks good in

Note: See TracTickets for help on using tickets.