Kuma: Add support for Cross-Origin search requests

Created on 4 Jan 2021  Â·  5Comments  Â·  Source: mdn/kuma

Description

I would like to be able to query the MDN Docs as documented here

Reason

I am currently developing a front-end component which would be able to search the MDN docs, and as it's hosted on a different domain from the MDN docs, a CORS error ensues

Steps to re-produce:

  • Open Dev Console on a page that isn't under developer.mozilla.org
  • Run fetch("https://developer.mozilla.org/api/v1/search/en-US?q=History%20Api")

What should happen

A successful request should go through and return JSON data

What happens

An error in the request with the classic CORS error message

Access to fetch at 'https://developer.mozilla.org/api/v1/search/en-US?q=History%20Api' from origin 'https://matsu.fi' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Most helpful comment

@Matsuuu This is on production as of around 7:30am Pacific time today.

All 5 comments

I see no reason not to do this. Any objections @escattone ?

@peterbe I agree. I think we should do this.

Thanks so much for the fast update!

Is there any estimate when this is going to hit prod? @peterbe

@Matsuuu This is on production as of around 7:30am Pacific time today.

Me interesa llame

1234

El mar., 5 ene. 2021 7:49, Matsuuu notifications@github.com escribió:

Thanks so much for the fast update!

Is there any estimate when this is going to hit prod? @peterbe
https://github.com/peterbe

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mdn/kuma/issues/7703#issuecomment-754438815, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ARM7HSDTPZMODQVGGYEIN6DSYKY6VANCNFSM4VTHILVQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterbe picture peterbe  Â·  7Comments

caitmuenster picture caitmuenster  Â·  3Comments

peterbe picture peterbe  Â·  6Comments

schalkneethling picture schalkneethling  Â·  7Comments

peterbe picture peterbe  Â·  12Comments