Internal server error on upload through API
I discovered that extensions.gnome.org has an API
According to https://extensions.gnome.org/api/docs/ I should be able to upload an extension by POST'ing mutlipart data to /api/vi/extensions
(see https://extensions.gnome.org/api/docs/#/v1/v1_extensions_create). However, when I try, I get back an ISE with an HTML page directing me to this issue form:
$ xh --json POST https://extensions.gnome.org/api/v1/accounts/login/ login=swsnr password=REDACTED
HTTP/2.0 200 OK
accept-ranges: bytes
allow: POST, OPTIONS
content-encoding: gzip
content-language: en
content-type: application/json
cross-origin-opener-policy: same-origin
date: Fri, 05 Jan 2024 18:26:43 GMT
referrer-policy: same-origin
server: nginx
set-cookie: REDACTED
strict-transport-security: max-age=31557600
vary: Accept, Accept-Language, origin
via: 1.1 varnish
x-cache: MISS
x-cache-hits: 0
x-content-type-options: nosniff
x-content-type-options: nosniff
x-frame-options: DENY
x-frame-options: SAMEORIGIN
x-served-by: cache-muc13968-MUC
x-timer: S1704479203.708394,VS0,VE613
{
"detail": "Login successful",
"token": {
"expiry": "2024-01-08T18:26:43.208373",
"token": "THE_TOKEN"
}
}
$ xh --multipart POST https://extensions.gnome.org/api/v1/extensions shell_license_compliant=true tos_compliant=true source@utc-clock@swsnr.de.shell-extension.zip Authorization:"Token THE_TOKEN" --verbose --output output.txt
The second request returns HTTP/2.0 500 Internal Server Error
. I've attached the full output.txt
as well as the extension file I'm trying to upload:
I could submit the very same file successfully through the upload form, see https://extensions.gnome.org/review/50026
What am I doing wrong?
Edited by Sebastian Wiesner