Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment server fails on URLs with diacritics #13

Open
loveablelobster opened this issue Oct 31, 2019 · 0 comments
Open

Attachment server fails on URLs with diacritics #13

loveablelobster opened this issue Oct 31, 2019 · 0 comments

Comments

@loveablelobster
Copy link

The Specify attachment server responds with an internal server error if the downloadname param contains UTF-8 diacritics (Specify 6 has no problems with this). So this request will work:

www.example.com/fileget?coll=Our+Whales+&type=O&filename=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.pdf&downloadname=Modtagelse+af+hvaler+1.pdf&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

While this will throw an error:
www.example.com/fileget?coll=Our+Whales+&type=O&filename=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.att.pdf&downloadname=Journal+på+sæler+-+vedhæftninger%5CNr.+2%5CVægt+%2B+foderskemaer.pdf&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Stack trace for the exmapel above:

Traceback (most recent call last):
  File "/home/specify/web-asset-server/bottle.py", line 856, in _handle
    return route.call(**args)
  File "/home/specify/web-asset-server/bottle.py", line 1716, in wrapper
    rv = callback(*a, **ka)
  File "/home/specify/web-asset-server/server.py", line 114, in wrapper
    result = func(*args, **kwargs)
  File "/home/specify/web-asset-server/server.py", line 104, in wrapper
    return func(*args, **kwargs)
  File "/home/specify/web-asset-server/server.py", line 213, in fileget
    download_name = quote(path.basename(download_name))
  File "/usr/lib64/python2.7/urllib.py", line 1283, in quote
    return ''.join(map(quoter, s))
KeyError: u'\xe5'
@maxpatiiuk maxpatiiuk transferred this issue from specify/specify7 Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant