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

ExtraHeaders doesn't work in browser #535

Closed
1 of 2 tasks
lu4 opened this issue Jan 30, 2017 · 1 comment
Closed
1 of 2 tasks

ExtraHeaders doesn't work in browser #535

lu4 opened this issue Jan 30, 2017 · 1 comment

Comments

@lu4
Copy link
Contributor

lu4 commented Jan 30, 2017

You want to:

  • report a bug
  • request a feature

Current behaviour

The feature #519 doesn't work. ExtraHeaders cancelled out through the call to undefined function in xhr called setDisableHeaderCheck.

Steps to reproduce (if the current behaviour is a bug)

Browser code:

let engine = engineio({
    transportOptions: {
        polling: {
            extraHeaders: {
                'X-TEST': 'ZZZ'
            }
        }
    }
});

engine.on('open', () => {
    console.log(['open', engine]);

    engine.send('another test');

    engine.on('message', (data) => {
        console.log(['message', data]);
    });

    engine.on('close', () => {
        console.log(['close', engine]);
    });
});

Server code:

let engineServer = engine.attach(httpsServer);

engineServer.on('connection', function (socket: any) {
    debugger; // socket.request.headers does not contain X-TEST header
    console.log(['connection', socket]);

    socket.send('test');

    socket.on('message', function(data: any) {
        console.log(['message', data, socket]);
    });

    socket.on('close', function() {
        console.log(['close', socket]);
    });
});

Expected behaviour

Headers are transferred from browser to client

Setup

  • OS: Mac OS X Sierra
  • browser: Google Chrome Version 55.0.2883.95 (64-bit)
  • engine.io version: 2.0.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

The problem seems to be little bit further along the road, to be specific with

xhr.setDisableHeaderCheck(true);

in xhr.setDisableHeaderCheck(true); xhr doesn't contain setDisableHeaderCheck, so what's the reason to accept extraHeaders if they will be cancelled later?

@darrachequesne
Copy link
Member

Closed by #536.

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

No branches or pull requests

2 participants