Skip to content

Commit 7312995

Browse files
committed
Merge branch 'master' of github.com:launchdarkly/js-client-private
2 parents 51bdefa + 5503693 commit 7312995

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

src/Requestor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ function fetchJSON(endpoint, body, callback) {
2525
if (body) {
2626
xhr.open('REPORT', endpoint);
2727
xhr.setRequestHeader('Content-Type', 'application/json');
28-
utils.addLDHeaders(xhr);
2928
xhr.send(JSON.stringify(body));
3029
} else {
3130
xhr.open('GET', endpoint);
32-
utils.addLDHeaders(xhr);
3331
xhr.send();
3432
}
3533

src/__tests__/Requestor-test.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sinon from 'sinon';
22
import Requestor from '../Requestor';
3-
import * as utils from '../utils';
43

54
describe('Requestor', () => {
65
let server;
@@ -84,22 +83,4 @@ describe('Requestor', () => {
8483
expect(handleFour.calledOnce).toEqual(true);
8584
expect(handleFive.calledOnce).toEqual(true);
8685
});
87-
88-
it('should send custom user-agent header in GET mode', () => {
89-
const requestor = Requestor('http://requestee', 'FAKE_ENV', false);
90-
const user = { key: 'foo' };
91-
requestor.fetchFlagSettings(user, 'hash1', sinon.spy());
92-
93-
expect(server.requests.length).toEqual(1);
94-
expect(server.requests[0].requestHeaders['X-LaunchDarkly-User-Agent']).toEqual(utils.getLDUserAgentString());
95-
});
96-
97-
it('should send custom user-agent header in REPORT mode', () => {
98-
const requestor = Requestor('http://requestee', 'FAKE_ENV', true);
99-
const user = { key: 'foo' };
100-
requestor.fetchFlagSettings(user, 'hash1', sinon.spy());
101-
102-
expect(server.requests.length).toEqual(1);
103-
expect(server.requests[0].requestHeaders['X-LaunchDarkly-User-Agent']).toEqual(utils.getLDUserAgentString());
104-
});
10586
});

src/utils.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,3 @@ export function chunkUserEventsForUrl(maxLength, events) {
126126

127127
return allChunks;
128128
}
129-
130-
export function getLDUserAgentString() {
131-
return 'JSClient/' + VERSION;
132-
}
133-
134-
export function addLDHeaders(xhr) {
135-
xhr.setRequestHeader('X-LaunchDarkly-User-Agent', getLDUserAgentString());
136-
}

0 commit comments

Comments
 (0)