BREAKING CHANGE: The request method of Proxy class now accepts and returns axios-specific values
BREAKING CHANGE: The default value of keepAlive setting has been changed to true
* make allowing CORS conditional
It turns out blindly allowing CORS could be a security hazard (who knew)
See https://github.com/w3c/webdriver/pull/1362 for the conversation that led to this realization.
This change makes the cross domain middleware conditional (defaulting to the current behavior).
This way Appium can pass in 'false' based on a flag, for better server security.
* actually include function parameter we can use from appium
* Add common websocket handlers
* tune the default prefix
* Add integration test
* Tune the test
* Fix the functional test
* Tune socket import
* Address review comments
* Tune some expectations
* Rename 'mjsonwp' to 'protocol'
* Renamed folder from 'mjsonwp' to 'protocol' in `lib/` and `test/`
* Renamed 'mjsonwp.js' to 'protocol.js'
* Renamed any import statements that use 'mjsonwp'
* _Possible breaking change_: MJSONWireProtocol class exposed in index was renamed to just Protocol.... checked Appium repo and found no libraries that use MJSONWireProtocol
* Lint fix
The webdriver spec specifies that requests where the method is POST
should be parsed as JSON (see https://www.w3.org/TR/webdriver/#processing-model step 6).
Appium is too restrictive. It only parses as JSON if the application/json
Content-Type is provided, making it incompatible with some Webdriver clients
that follow the spec but don't send a Content-Type header.
This commit makes Appium less restrictive by defaulting to the application/json
Content-Type if none is provided.