Skip to content

Commit

Permalink
prepare 1.7.4 release (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-darkly authored May 23, 2018
1 parent 7312995 commit a6ae2c6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to the LaunchDarkly client-side JavaScript SDK will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org).

## [1.7.4] - 2018-05-23
### Fixed
- Fixed a bug that caused events _not_ to be sent if `options.sendEvents` was explicitly set to `true`.
- 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))

## [1.7.3] - 2018-05-08
### Fixed
- The client no longer creates an empty `XMLHttpRequest` at startup time (which could interfere with unit tests).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ldclient-js",
"version": "1.7.3",
"version": "1.7.4",
"description": "LaunchDarkly SDK for JavaScript",
"author": "LaunchDarkly <[email protected]>",
"license": "Apache-2.0",
Expand Down
6 changes: 5 additions & 1 deletion src/Requestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ function fetchJSON(endpoint, body, callback) {
const xhr = new XMLHttpRequest();

xhr.addEventListener('load', () => {
if (xhr.status === 200 && xhr.getResponseHeader('Content-type') === json) {
if (
xhr.status === 200 &&
xhr.getResponseHeader('Content-type') &&
xhr.getResponseHeader('Content-Type').startsWith(json)
) {
callback(null, JSON.parse(xhr.responseText));
} else {
callback(xhr.statusText);
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function initialize(env, user, options = {}) {
const eventsUrl = options.eventsUrl || 'https://events.launchdarkly.com';
const streamUrl = options.streamUrl || 'https://clientstream.launchdarkly.com';
const hash = options.hash;
const sendEvents = typeof options.sendEvents === 'undefined' ? true : config.sendEvents;
const sendEvents = typeof options.sendEvents === 'undefined' ? true : options.sendEvents;
const environment = env;
const emitter = EventEmitter();
const stream = Stream(streamUrl, environment, hash, options.useReport);
Expand Down

0 comments on commit a6ae2c6

Please sign in to comment.