react-native/ReactAndroid
Christopher Dro 205b5d4732 Update options parameter to headers. Update to spec.
Summary:This is a follow up of 9b87e6c860.

- Allows custom headers on connection request
- Adds a default `origin` header to Android, just like iOS

**Introduces no breaking changes.**

I was working on something similar and would like to propose a few changes that make the API more consistent across both iOS and Android platforms and brings this closer to [spec](https://tools.ietf.org/html/rfc6455).

I believe aprock first implementation of adding custom `headers` was correct. It makes sense naming this argument `headers` since we have no other general options available, and the current `options` field is being used to pass in a header anyway.

My use case for custom headers was attaching a token to the `Authorization` header on the connection request. I have been testing this by passing a JWT inside the `Authorization` header and verifying it on the server before establishing a connection.
Closes https://github.com/facebook/react-native/pull/6016

Differential Revision: D3040735

Pulled By: nicklockwood

fb-gh-sync-id: f81bd14ccbdba36309b9d4b4850fb66fe4deae11
shipit-source-id: f81bd14ccbdba36309b9d4b4850fb66fe4deae11
2016-03-15 05:14:21 -07:00
..
libs Add BUCK files 2016-01-22 16:20:13 +00:00
src Update options parameter to headers. Update to spec. 2016-03-15 05:14:21 -07:00
.npmignore Don't publish /ReactAndroid/build to npm, update version on master 2015-10-12 11:11:40 -07:00
DEFS Initialize glog in react native 2016-03-10 06:02:21 -08:00
DevExperience.md Fixed typo 2015-12-31 12:26:10 +04:00
README.md Clean up docs on building RN Android from source 2016-02-18 07:59:39 -08:00
build.gradle instrumentation tests are executed with BUCK 2016-03-02 06:55:35 -08:00
gradle.properties Ability to run unit tests in react-android-github via gradle 2015-11-27 04:20:19 -08:00
release.gradle New release process: Fix installArchives 2016-02-09 10:30:32 -08:00

README.md

Building React Native for Android

See docs on the website.