Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Feature Request: Allow CORS for search API #143

Open
dchisolm opened this issue Sep 29, 2021 · 4 comments
Open

Feature Request: Allow CORS for search API #143

dchisolm opened this issue Sep 29, 2021 · 4 comments

Comments

@dchisolm
Copy link

In order to better support integration with other documentation sites, it would be beneficial to be able to selectively allow CORS requests to the search API such as https://api.docs.cpanel.net/search-index.json?q=mysql&l=100.

We would accept being able to add it to our developer portal via code/configuration if possible, however if I am recalling correctly, this portion of the application is already bundled and not easily edited?

The lack of CORS support is blocking some important integrations for us currently. Any direction that you can provide would be appreciated.

Thanks

@adamaltman
Copy link
Member

What origin (domain) do you want to call that search index from?

@adamaltman
Copy link
Member

And you're not planning to call it from a server? You can like this:

curl "https://api.docs.cpanel.net/search-index.json?q=mysql&l=100"

@dchisolm
Copy link
Author

Hi Adam,

This is being called in front-end javascript. IE from sites like https://docs.cpanel.net/.

@adamaltman
Copy link
Member

You could access it through a CORS proxy. We might be able to enable CORS -- we need to consider any security implications. Is there an exhaustive list of sites which would be calling it? Or is it limited to a few domains (or even better, only subdomains of cpanel.net)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants