developit / developit/redaxios

POST requests that work with Axios throw CORS error with Redaxios

Open
#84 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.9k
Forks
104
PR merge metrics
No merged PRs in 30d

Description

First, thank you for this awesome project! What a huge transfer size savings Redaxios is over Axios.

We have some code like below that works fine with Axios but fails with Redaxios:

```js
const response = await axios({
method: 'POST',
url: getApiUrl(),
data: {
...formData,
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
});
```

We get:

> `Access to fetch at 'https://example.com/' from origin 'http://localhost:1212' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.`

[It seems possibly related to this question/answer](https://stackoverflow.com/a/37562814)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.