karma-runner / karma-safari-launcher

A Karma plugin. Launcher for Safari.
MIT License
19 stars 15 forks source link

Injecting custom headers #8

Open ianbattersby opened 10 years ago

ianbattersby commented 10 years ago

When testing PhantomJS and Chrome we create customLaunchers for each, extending their base, and then adding customHeaders option; these headers are then added to every web request made. However with Safari this doesn't seem to happen, certainly not on the XHR requests going through.

Do you know if Safari will support this? If so, do we perhaps need to use a different option?

Example

           'Safari_custom': {
                base: 'Safari',
                options: {
                    windowName: 'my-window',
                    settings: {},
                    customHeaders: {
                        'X-Custom-Header': 'Something'
                    }
                },
                flags: []
            },

Note We notice this in the DEBUG output and are unsure if relevant:

[2014-08-13 14:50:14.135] [DEBUG] web-server - upgrade /socket.io/1/websocket/Ccycwm_zbRKjy63yoB3E
[2014-08-13 14:50:14.135] [DEBUG] proxy - NOT upgrading proxyWebSocketRequest /socket.io/1/websocket/Ccycwm_zbRKjy63yoB3E

Any assistance or thoughts much appreciated!