REST API treats URL encoded forward slash as a slash

Bug #788687 reported by Michał Karnicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Servers
Confirmed
High
Vincenzo Di Somma

Bug Description

If the filename contains URL encoded forward slash %2F

Result:
The server decodes that as a slash and instead of foo%2Fbar.png you'll get a folder foo and a file bar.png in it.

Expected behaviour:
Create file foo%2Fbar.png

Tags: rest-api
Michał Karnicki (karni)
visibility: private → public
Revision history for this message
Michał Karnicki (karni) wrote :

Changing status to Confirmed, server is OOPSing on such filenames, google map icons for instance. I'll probably fix this on the client side replacing % with _, but that's just temporary fix, it's not the client fault that a filename may contain URL encoded characters. Stuart Langridge said it's clearly a bug.

Changed in ubuntuone-servers:
status: New → Confirmed
Revision history for this message
Vincenzo Di Somma (vds) wrote :
Download full text (4.2 KiB)

Traceback

  DoesNotExist: The provided Node id does not exist.

    Traceback (most recent call last):
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/storage/data/gateway.py, line 1414, in get_node_by_path
    raise errors.DoesNotExist(self.node_dne_error)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/storage/data/dao.py, line 325, in get_node_by_path
    remaining_path, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/storage/data/stormutil.py, line 187, in decorated
    result = function(*args, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/storage/data/stormutil.py, line 68, in decorated
    value = function(*args, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/storage/data/resthelper.py, line 158, in get_node
    node = user.get_node_by_path(node_path, with_content=True)
  Module /srv/ubuntuone.com/ubunet/servers/u1servers/updown/views.py, line 230, in rest_upload_view
    node_info = helper.get_node(user, path)
  Module /srv/ubuntuone.com/ubunet/lib/django/contrib/auth/decorators.py, line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/oauth/decorators.py, line 28, in wrapper
    return func(request, *args, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/ubuntuone/contrib/djangolib.py, line 32, in __dispatch
    return handler(request, *args, **kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/django/core/handlers/base.py, line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  Module /srv/ubuntuone.com/ubunet/lib/django/core/handlers/wsgi.py, line 241, in __call__
    response = self.get_response(request)
  Module /usr/lib/pymodules/python2.6/paste/translogger.py, line 68, in __call__
    return self.application(environ, replacement_start_response)
DoesNotExist: ' The provided Node id does not exist.'

== EXTRA DATA ==
{'log': {'records': [{'created': 1306782970.0943561,
                      'filename': 'handlers.py',
                      'funcName': 'handle_uncaught_exception',
                      'levelname': 'ERROR',
                      'levelno': 40,
                      'lineno': 47,
                      'message': 'WSGI Handled Exception (OOPSID 1976updownZGcBfbbfbEJCFEDIeICaBfddCDfbeJdGA9760)',
                      'module': 'handlers',
                      'msecs': 94.356060028076172,
                      'msg': 'WSGI Handled Exception (OOPSID 1976updownZGcBfbbfbEJCFEDIeICaBfddCDfbeJdGA9760)',
                      'name': 'root',
                      'pathname': '/srv/ubuntuone.com/ubunet/lib/ubuntuone/wsgi/handlers.py',
                      'process': 22178,
                      'processName': 'MainProcess',
                      'relativeCreated': 3210313.0259513855,
                      'thread': -1325421712,
                      'threadName': 'Dummy-18'},
                     {'asctime': '2011-05-30 19:16:10,127',
                      'created': 1306782970.1271629,
                      'filename': 'translogger.py',
                      'funcName': 'write_log',
                      'levelname': 'INFO',
                      'levelno': 20,
                      ...

Read more...

Vincenzo Di Somma (vds)
Changed in ubuntuone-servers:
importance: Undecided → Critical
assignee: nobody → Vincenzo Di Somma (vds)
John O'Brien (jdobrien)
Changed in ubuntuone-servers:
importance: Critical → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.