Skip to content

New check for a custom Authorization header is case sensitive. Headers are case insensitive #1043

@GaryAustin1

Description

@GaryAustin1

Bug report

  • [x ] I confirm this is a bug with Supabase, not with my own application.
  • [ x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

The new code added 3 weeks ago is checking for an Authorization header. It looks for 'Authorization' in the header array. http headers are case insensitive.

Just worked on a user issue where they loaded the header in authorization = .... and then used the header option authorization in the global headers object.
This should work.

The change was here @kangmingtay
(https://github.com/supabase/supabase-js/blame/4dff472a15cb754bf9fa81af495a84b1f0c42b14/src/SupabaseClient.ts#L282)

To Reproduce

use

global: {
    headers: { 'authenticated': 'bearer myjwt' }

in createClient

Expected behavior

Case of header name should not matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions