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 created this task.Jan 16 2015, 11:25 AM
phuedx raised the priority of this task from to Needs Triage.
phuedx updated the task description. (Show Details)
phuedx added a project: Readers-Web-Backlog.
phuedx added subscribers: phuedx, Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 16 2015, 11:25 AM
gerritbot added a subscriber: gerritbot.

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

phuedx claimed this task.Jan 16 2015, 1:07 PM
phuedx set Security to None.
phuedx updated the task description. (Show Details)Jan 16 2015, 1:10 PM

@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

Jdlrobson closed this task as Resolved.Jan 16 2015, 8:18 PM