gridaco / cors.sh

Sick of CORS Errors?
https://cors.sh
MIT License
185 stars 10 forks source link

add x-strict-request-url handler #39

Closed softmarshmallow closed 1 year ago

softmarshmallow commented 1 year ago

Ref: https://github.com/gridaco/cors.sh/issues/38

We are adding new header x-strict-request-url Which users can set the same request url, but preventing it from getting altered (url-encoded, trailing slash being removed)

You can use this the same way you did, but with extra header

// example with tiktok api
fetch("https://proxy.cors.sh/https://open.tiktokapis.com/v2/user/info/?fields=open_id", {
     headers: {
         "x-cors-api-key": "<your-cors.sh-api-key>",
         "Authorization": "Bearer <your-tiktok-token>",
         // NEW (enter the same url)
         "x-strict-request-url": "https://open.tiktokapis.com/v2/user/info/?fields=open_id"
    }
})
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cors-sh ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 18, 2023 at 8:29AM (UTC)
cors-sh-console ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 18, 2023 at 8:29AM (UTC)
1 Ignored Deployment | Name | Status | Preview | Comments | Updated | | :--- | :----- | :------ | :------- | :------ | | **docs-cors-sh** | ⬜️ Ignored ([Inspect](https://vercel.com/grida/docs-cors-sh/CJkanjapWULZ6JmLu3XZz7btfVAL)) | | | Jan 18, 2023 at 8:29AM (UTC) |