Page MenuHomePhabricator

Article recommendation API missing CORS header
Closed, ResolvedPublic

Description

Content translations article suggestion feature no longer works because of missing CORS header

XMLHttpRequest cannot load https://recommend.wmflabs.org/api?s=en&t=es&article=Waste+Isolation+Pilot+Plant%7CMontevideo%7CUltima+Tower&search=wiki&application=CX. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://en.wikipedia.org' is therefore not allowed access.

Event Timeline

Change 315225 had a related patch set uploaded (by Nschaaf):
Add wiki search to revert regression

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

It looks like this may be due to the url being /api?s=.... which gives a 301 to /api/?s=...., which has the proper headers in place.

Change 315225 merged by jenkins-bot:
Add wiki search to revert regression

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

It looks like this may be due to the url being /api?s=.... which gives a 301 to /api/?s=...., which has the proper headers in place.

Ok, so we will change the URL slightly so that it ends with / and avoid redirect

Change 315227 had a related patch set uploaded (by Santhosh):
Avoid 301 with recommend tool API

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

Change 315227 merged by jenkins-bot:
Avoid 301 with recommend tool API

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

Arrbee claimed this task.