Skip to content

Optional disable setting headers keys in lowercase #304

@andresgutgon

Description

@andresgutgon

Hi, I'm trying to use fetch in Chrome but I think it's not working for me for one reason. I'll explain my use case and you can tell me if I can do something to use fetch.

I'm developing a Chrome extension (a content script) that reads from localStorage an auth token. This way I can make request agains a server. I'm not managing that server and I'm not the owner. I can't change anything on the server. The thing is that I'm trying this:

fetch(url, {
  method: "GET",
  headers: {
    "Token": "auth-token-content-goes-hear"
  },
})

But when I see the request on Chrome Dev Tools I see token instead of Token and the server is responding with 401. My first implementation is doing the same with jQuery and the server is returning results.

I understand the standard is put headers in lowercase. But maybe could be posible set a flag to skip it. In situations like mine (user can not change server) is not posible to use fetch.

BTW great work! I appreciate all the work you are doing here 💪

Thanks!

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