Issue #1284 new breaks on URI paths which contain ://

Eric Higgins
created an issue

I have a web application that acts as a proxy to fetch remote resources. To keep things lightweight, the remote URL is sent as the path of my web application. Example (not actually my domain):

There appears to be a bug in CherryPy's (around here) that causes paths like this to blow up. This block of code looks like a good use case for urlparse.

Note: I don't use CherryPy directly, but it's been added to the Google App Engine SDK as part of dev_appserver2. As such, we have no real way to fix or patch this bug. We are able to use the old for now, though.

Comments (4)

  1. Eric Higgins reporter

    Certainly. Here's the traceback (with our local usernames/paths altered):

    ValueError('need more than 1 value to unpack',)
    Traceback (most recent call last):
      File "/src/gae-1.8.8/lib/cherrypy/cherrypy/wsgiserver/", line 1292, in communicate
      File "/src/gae-1.8.8/lib/cherrypy/cherrypy/wsgiserver/", line 580, in parse_request
        success = self.read_request_line()
      File "/src/gae-1.8.8/lib/cherrypy/cherrypy/wsgiserver/", line 643, in read_request_line
        scheme, authority, path = self.parse_request_uri(uri)
      File "/src/gae-1.8.8/lib/cherrypy/cherrypy/wsgiserver/", line 805, in parse_request_uri
        authority, path = remainder.split(FORWARD_SLASH, 1)
    ValueError: need more than 1 value to unpack

    To debug this, I had to modify and and use PDB. on the line I linked you to, the value of the uri variable was /, which leads me to believe that it's just being given the path instead of the full URL.

  2. Log in to comment