Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1727 (closed defect: wontfix)

Opened 11 years ago

Last modified 10 years ago

urllib quoted values as args

Reported by: deanlandolt Owned by: anonymous
Priority: normal Milestone:
Component: TurboGears Version: trunk
Severity: normal Keywords:
Cc:

Description

When passing an escaped argument to a controller, such as:

 http://localhost:8080/feed/http%3A%2F%2Fdeanlandolt.com%2Ffeed%2Fatom%2F

This was interpreted as one arg in 1.0.x but in trunk, the %2F values get unescaped to '/' and it gets interpreted as 4 args. Also, the %3F (?) and %3D (=) passed through uninterpreted, rather than causing kwargs to be initialized.

Change History

comment:1 Changed 11 years ago by mramm

Is there any reason why you wouldn't want to do

def test_url_encoded_param_passing(self):
  resp = self.app.get('/feed?feed=http%3A%2F%2Fdeanlandolt.com%2Ffeed%2Fatom%2F') 
  resp.body assert "http://deanlandolt.com/feed/atom/" in resp.body

which would hit feed function with a keyword parm feed?

We're getting a pre-parsed URL from the request object, and while the above works right now, it may take a bit to figure out how to support the syntax you want. I do, however, think that it's the right thing to do to treed %2F differently than /, as that's specifically a use case in the HTTP URI spec, so we'll have to figure something out....

comment:2 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

Yea, I did quite a bit of research on this, and it looks like we don't have access to an un-encoded string representation of the path -- but we do of the querrystring.

Looks like this is a CGI issue, which carried over into WSGI.

Robert Brewer explains it in the WSGI server source here:

 http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__.py#L307

There was also a web-sig list discussion of this last month precipitate by Ben's e-mail here:

 http://mail.python.org/pipermail/web-sig/2008-January/003122.html

So, unless the WSGI spec changes, you'll need to put this stuff into the querystring.

comment:3 Changed 10 years ago by anonymous

  • Milestone 2.0-preview-1 deleted

Milestone 2.0-preview-1 deleted

Note: See TracTickets for help on using tickets.