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

Options persisting between successive calls when using phin.defaults() #46

Closed
bdr99 opened this issue Dec 27, 2019 · 0 comments
Closed
Labels
Bug Important This is a critical issue

Comments

@bdr99
Copy link

bdr99 commented Dec 27, 2019

When using an instance created from phin.defaults(), any options passed will persist between successive calls.

For example:

const phinInstance = phin.defaults({
    url: "https://httpbin.org/get"
});

await phinInstance({
    method: "GET",
    headers: {
        foo: "bar"
    }
});

await phinInstance({
    method: "GET"
});

Expected result: the first HTTP request should be sent with header "foo": "bar", and the second one should not.

Actual result: both HTTP requests are sent with header "foo": "bar".

@ethan7g ethan7g added Bug Important This is a critical issue labels Dec 28, 2019
@ethan7g ethan7g closed this as completed in 56449b0 Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Important This is a critical issue
Projects
None yet
Development

No branches or pull requests

2 participants