[HTTP Upload] Filename should not be percent-encoded
In short: if you upload a file called "100%.jpg" to Prosody HTTP upload service with Gajim, you wan't be able to download it.
Gajim percent-encodes file name in urn:xmpp:http:upload:0 slot request, which it probably shouldn't do.
XEP-0363 does not explicitly state percent encoding for slot request, but the example has non-ascii symbols:
<iq from='romeo@montague.tld/garden'
id='step_03'
to='upload.montague.tld'
type='get'>
<request xmlns='urn:xmpp:http:upload:0'
filename='très cool.jpg'
size='23456'
content-type='image/jpeg' />
</iq>
This is what Gajim sends for "100%.jpg" filename:
<iq xmlns="jabber:client" to="xup.valdikss.org.ru" type="get" id="cc9d3b07-4eaa-479b-9399-bd474a9689a8" from="iam@valdikss.org.ru/0566514a-b95b-4edb-ada9-427b6395c5a3">
<request xmlns="urn:xmpp:http:upload">
<filename>100%25.jpg</filename>
<size>202022</size>
<content-type>image/jpeg</content-type>
</request>
</iq>
Which causes the server to return double percent-encoded URL:
<iq id='cc9d3b07-4eaa-479b-9399-bd474a9689a8' type='result' to='iam@valdikss.org.ru/0566514a-b95b-4edb-ada9-427b6395c5a3' from='xup.valdikss.org.ru'>
<slot xmlns='urn:xmpp:http:upload'>
<get>https://xup.valdikss.org.ru:5281/upload/jXIeu-_TZbXXZU_X/100%2525.jpg</get>
<put>https://xup.valdikss.org.ru:5281/upload/jXIeu-_TZbXXZU_X/100%2525.jpg</put>
</slot>
</iq>
This double-encoded URL is ugly and triggers a bug in Prosody code (it should be fixed in Prosody, but only Gajim encodes names in the request).
Versions
- OS: Linux
- Gajim version: 1.0.3
- GTK version: 3.22.30
- Python-nbxmpp version: 0.6.6
Steps to reproduce the problem
- Upload file with "100%.jpg" filename using HTTP Upload to Prosody
- Click on the link
Expected behavior
The file opens.
Actual behavior
The file doesn't open, HTTP error 404.