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

Proxy-Authorization header created with basic with a small "b" #22383

Closed
Buluc-Celik-Ozbul opened this issue Jun 17, 2022 · 4 comments · Fixed by #22471
Closed

Proxy-Authorization header created with basic with a small "b" #22383

Buluc-Celik-Ozbul opened this issue Jun 17, 2022 · 4 comments · Fixed by #22471

Comments

@Buluc-Celik-Ozbul
Copy link
Contributor

Current behavior

When I set up a proxy with username and password, the Proxy-Authorization header is created with basic type but it says "basic" with small "b" and this fails with some proxies
image

Desired behavior

The Proxy-Authorization header should have been created with "Basic" keyword with a capital "B"

Test code to reproduce

The script used:
"set HTTP_PROXY=http://username:password@proxy_ip:8080 & cypress open --browser chrome --config-file cypress.json"

The test function:
And("I try cypress request", () => {

var url = `https://www.somewebsite.com/`;

const options = {
    method: 'GET',
    url: url
};

cy.request(options).then((response) => {
    console.log('cypress request: ', response);
});

});

Cypress Version

9.7.0

Other

No response

@lmiller1990 lmiller1990 added stage: needs investigating Someone from Cypress needs to look at this E2E-auth labels Jun 22, 2022
@lmiller1990
Copy link
Contributor

My understanding is Basic is correct, and basic is not. Seems like a bug we should fix - I've marked it as such, and someone will look into it.

I'm not sure where the code that sets this is, but if you'd like to try make a PR, that'd be great, too - you can probably just do a full text, case sensitive search of the code base to find out where it's set.

@Buluc-Celik-Ozbul
Copy link
Contributor Author

Buluc-Celik-Ozbul commented Jun 22, 2022

Hi, thanks for the quick response. I have prepared a commit, but I got this:
remote: Permission to cypress-io/cypress.git denied to Buluc-Celik-Ozbul.

I guess I need permission to push. Alternatively, here are the only needed changes if you could do it instead:

/packages/network/lib/agent.ts
line 41:
- connectReq.push(Proxy-Authorization: basic ${Buffer.from(proxy.auth).toString('base64')})
+ connectReq.push(Proxy-Authorization: Basic ${Buffer.from(proxy.auth).toString('base64')})

/packages/network/test/unit/agent_spec.ts
line 611:
- 'Proxy-Authorization: basic YmF6OnF1dXg=',
+ 'Proxy-Authorization: Basic YmF6OnF1dXg=',

@mjhenkes
Copy link
Member

@Buluc-Celik-Ozbul, you will need to fork the repo to contribute.

https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: needs investigating Someone from Cypress needs to look at this labels Jun 22, 2022
@emilyrohrbough emilyrohrbough removed the stage: awaiting response Potential fix was proposed; awaiting response label Jun 23, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 19, 2022

Released in 10.3.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.3.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants