Skip to content
Snippets Groups Projects
Closed Bug: Using Sourcegraph.com GraphQL API from other websites is broken
  • View options
  • Bug: Using Sourcegraph.com GraphQL API from other websites is broken

  • View options
  • Closed Issue created by Warren Gifford

    Created by: slimsag

    Problem: If you try to use https://sourcegraph.com/.api/graphql from another website, it is blocked due to CORS because we're not setting any Content-Security-Policy for responses from that URL, it defaults and is thus blocked:

    Content Security Policy: The page’s settings blocked the loading of a resource at https://sourcegraph.com/.api/graphql?SearchContexts (“default-src”).

    Are you ready for some history?

    In short:

    1. https://sourcegraph.com/.api/graphql should have a Content-Security-Policy which allows requests from any origin.
    2. This should be completely safe and secure to enable, and was the original intended behavior - but obviously needs verification.

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first