Skip to content

Adding support XMLHttpRequest.withCredentials parameter #43

@totaldict

Description

@totaldict

I am making a request where I need to pass the cookies for the current domain to another domain i.e. CORS request. Currently cookies aren't sent when making CORS requests.

The scenario:

I am on https://example.com and I make a request

syncRequest('GET', 'https://api.example.com')

This leads to a 401 unauthorised because the cookie isn't sent.

I believe the underlying request is made using XMLHttpRequest. Some documentation suggests you can include cookies when making CORS requests by setting XMLHttpRequest.withCredentials = true.

Thus, it is necessary to modify the "then-request".

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