Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

GET requests to catalog fail with CORS Missing Allow Origin #125

@mbates

Description

@mbates

I am trying to use the catalog API but requests are failing with CORS Missing Allow Origin.

I can use curl to send GET requests to the sandbox API and I get the expected result.

But when I send the same request from my webapp, which includes the origin and referer headers, the response is a 403 with "CORS Missing Allow Origin"

This works

 curl "https://connect.squareupsandbox.com/v2/catalog/list" -H "User-Agent: Square-TypeScript-SDK/8.0.0" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "authorization: Bearer SANDBOX_ACCESS_TOKEN" -H "Square-Version: 2020-12-16" -H "Connection: keep-alive"

This fails

curl "https://connect.squareupsandbox.com/v2/catalog/list" -H "User-Agent: Square-TypeScript-SDK/8.0.0" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "authorization: Bearer SANDBOX_ACCESS_TOKEN" -H "Square-Version: 2020-12-16" -H "Origin: http://dev.domain.com" -H "Connection: keep-alive" -H "Referer: http://dev.domain.com/product-list"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions