Skip to content

Commit 43e6863

Browse files
authored
Merge pull request #2 from optimizely/mng/fix-cors-issue
Add CORS param to prevent browsers from logging cors errors in the co…
2 parents 4defbd8 + e0bc66e commit 43e6863

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

CONTRIBUTING.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ We welcome contributions and feedback! Please read the [README](README.md) to se
77
1. Create a branch off of `master`: `git checkout -b YOUR_NAME/branch_name`.
88
2. Commit your changes. Make sure to add tests!
99
3. Run `npm run lint` to ensure there are no lint errors.
10-
4. `git push` your changes to GitHub.
11-
5. Make sure that all unit tests are passing and that there are no merge conflicts between your branch and `master`.
12-
6. Open a pull request from `YOUR_NAME/branch_name` to `master`.
13-
7. A repository maintainer will review your pull request and, if all goes well, merge it!
10+
4. Run `webpack` to generate the built and minified file for those not installing via `npm`
11+
5. `git push` your changes to GitHub.
12+
6. Make sure that all unit tests are passing and that there are no merge conflicts between your branch and `master`.
13+
7. Open a pull request from `YOUR_NAME/branch_name` to `master`.
14+
8. A repository maintainer will review your pull request and, if all goes well, merge it!
1415

1516
##Pull request acceptance criteria
1617

dist/optimizely.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/plugins/event_dispatcher/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ module.exports = {
1111
*/
1212
dispatchEvent: function(url, params) {
1313
return new bluebird(function(resolve, reject) {
14+
// add param for cors headers to be sent by the log endpoint
15+
url += '?wxhr=true';
1416
if (params) {
15-
url += '?' + toQueryString(params);
17+
url += '&' + toQueryString(params);
1618
}
1719

1820
var req = new XMLHttpRequest();

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "optimizely-client-sdk",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Javascript SDK for client testing",
55
"main": "index.js",
66
"scripts": {
@@ -21,7 +21,7 @@
2121
"dependencies": {
2222
"bluebird": "^3.4.0",
2323
"lodash": "^4.13.1",
24-
"optimizely-server-sdk": "^0.1.1"
24+
"optimizely-server-sdk": "^0.1.2"
2525
},
2626
"devDependencies": {
2727
"chai": "^3.5.0",

0 commit comments

Comments
 (0)