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

fix Authorization Header is removed even if it should not (close #1016) #1020

Merged
merged 1 commit into from
Jan 27, 2017

Conversation

LavrovArtem
Copy link
Contributor

@LavrovArtem
Copy link
Contributor Author

/cc @VasilyStrelyaev

if (typeof header === 'string' && AUTHORIZATION.headers.indexOf(header.toLowerCase()) !== -1)
value = AUTHORIZATION.valuePrefix + value;

nativeMethods.xhrSetRequestHeader.call(this, header, value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return

/* eslint hammerhead/proto-methods: 2 */

export default {
valuePrefix: 'hammerhead-prefix-by-client',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hammerhead-prefix-by-client --> hammerhead|prefix|by-client

if (this.readyState === this.DONE) {
var headers = JSON.parse(this.responseText);

Object.keys(headers).forEach(function (header) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just check 4 headers, without foreach function

it('Should pass authorization headers which are defined by client for cross-domain request without credentials (GH-1016)', function (done) {
var options = {
url: proxy.openSession('http://127.0.0.1:2002/echo-headers-with-credentials', session),
headers: AUTHORIZATION.headers.reduce(function (obj, header, index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use more simple code - without reduce, set all headers manualy

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 2d4aba0 have failed. See details:

@testcafe-build-bot
Copy link
Collaborator

✅ Tests for the commit 1081636 have passed. See details:

@miherlosev miherlosev merged commit 2798b93 into DevExpress:master Jan 27, 2017
@LavrovArtem LavrovArtem deleted the i1016 branch January 27, 2017 10:58
AndreyBelym pushed a commit to AndreyBelym/testcafe-hammerhead that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants