Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is problem for header content-type in v1.x #5208

Closed
creamidea opened this issue Oct 31, 2022 · 3 comments
Closed

There is problem for header content-type in v1.x #5208

creamidea opened this issue Oct 31, 2022 · 3 comments

Comments

@creamidea
Copy link

creamidea commented Oct 31, 2022

Describe the bug

Recently, I upgrade axios to be 1.1.3 and meet the problem: content-type is not be set correctly. Like below. But, it is ok with 0.27.2. Please help me.

image

To Reproduce

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="https://cdn.jsdelivr.net/npm/axios@1.1.3/dist/axios.min.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/axios@0.27.2/dist/axios.min.js"></script> -->
    <script>
      axios.post(
        "/test",
        { user: 1 },
        {
          headers: {
            "content-type": "application/json",
          },
        }
      );
    </script>
  </body>
</html>

Code snippet

Expected behavior

No response

Axios Version

1.1.3

Adapter Version

xhr

Browser

Chrome

Browser Version

106.0.5249.119

Node.js Version

No response

OS

MacOS 12.6

Additional Library Versions

No response

Additional context/Screenshots

No response

@creamidea creamidea changed the title There is not supported or problem for header content-type in v1.x There is problem for header content-type in v1.x Oct 31, 2022
@BrianLeishman
Copy link

Just noticed today as well. Looks like <v1.x.x handled the case insensitive headers correctly but now it does not.

@fabb
Copy link

fabb commented Nov 5, 2022

Probably fixed by #5224

@jasonsaayman
Copy link
Member

Hi 👋

Please try the latest pre-release by running the following:

npm i axios@1.2.0-alpha.1

Please provide feedback in either the pinned issue or the discussion thread 🧵

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

No branches or pull requests

4 participants