Skip to content

Commit a6ae2c6

Browse files
authored
prepare 1.7.4 release (#88)
1 parent 7312995 commit a6ae2c6

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
All notable changes to the LaunchDarkly client-side JavaScript SDK will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org).
55

6+
## [1.7.4] - 2018-05-23
7+
### Fixed
8+
- Fixed a bug that caused events _not_ to be sent if `options.sendEvents` was explicitly set to `true`.
9+
- HTTP requests will no longer fail if there is a `charset` specified in the response's `Content-Type` header. ([#87](https://github.com/launchdarkly/js-client/issues/87))
10+
611
## [1.7.3] - 2018-05-08
712
### Fixed
813
- The client no longer creates an empty `XMLHttpRequest` at startup time (which could interfere with unit tests).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ldclient-js",
3-
"version": "1.7.3",
3+
"version": "1.7.4",
44
"description": "LaunchDarkly SDK for JavaScript",
55
"author": "LaunchDarkly <[email protected]>",
66
"license": "Apache-2.0",

src/Requestor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ function fetchJSON(endpoint, body, callback) {
88
const xhr = new XMLHttpRequest();
99

1010
xhr.addEventListener('load', () => {
11-
if (xhr.status === 200 && xhr.getResponseHeader('Content-type') === json) {
11+
if (
12+
xhr.status === 200 &&
13+
xhr.getResponseHeader('Content-type') &&
14+
xhr.getResponseHeader('Content-Type').startsWith(json)
15+
) {
1216
callback(null, JSON.parse(xhr.responseText));
1317
} else {
1418
callback(xhr.statusText);

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function initialize(env, user, options = {}) {
2020
const eventsUrl = options.eventsUrl || 'https://events.launchdarkly.com';
2121
const streamUrl = options.streamUrl || 'https://clientstream.launchdarkly.com';
2222
const hash = options.hash;
23-
const sendEvents = typeof options.sendEvents === 'undefined' ? true : config.sendEvents;
23+
const sendEvents = typeof options.sendEvents === 'undefined' ? true : options.sendEvents;
2424
const environment = env;
2525
const emitter = EventEmitter();
2626
const stream = Stream(streamUrl, environment, hash, options.useReport);

0 commit comments

Comments
 (0)