Page MenuHomePhabricator

Photo uploads broken locally
Closed, ResolvedPublic

Description

Quoting myself from 182134:

If wgMFPhotoUploadEndpoint isn't set, then you can't upload a photo locally.

When wgMFPhotoUploadEndpoint isn't set, the PhotoApi#save uses mw.Api.post (not postWithToken) to upload the photo and the upload API action requires a CSRF token.

ForeignApi is a useful abstraction but it isn't interchangeable with mw.Api in this situation.

and

… nor if you set wgMFPhotoUploadEndpoint to "http://127.0.0.1:8080/w/api.php".

This isn't a fire bucket task, as our production setup shouldn't trigger this behaviour.

Event Timeline

phuedx raised the priority of this task from to Needs Triage.
phuedx updated the task description. (Show Details)
phuedx added a project: Web-Team-Backlog.
phuedx added subscribers: phuedx, Jdlrobson.
gerritbot subscribed.

Change 185423 had a related patch set uploaded (by Phuedx):
[WIP] Work around ForeignApi/mw.Api inconsistency

https://gerrit.wikimedia.org/r/185423

Patch-For-Review

@Jdlrobson: 185423 is a workaround. We should chat about ForeignApi/mw.Api and tokens.

Change 185423 abandoned by Phuedx:
Work around ForeignApi/mw.Api inconsistency

https://gerrit.wikimedia.org/r/185423

Change 185486 had a related patch set uploaded (by Phuedx):
Rename ForeignApi#post to #postWithToken

https://gerrit.wikimedia.org/r/185486

Patch-For-Review

Change 185486 merged by jenkins-bot:
Rename ForeignApi#post to #postWithToken

https://gerrit.wikimedia.org/r/185486