Comparing version 0.1.1 to 0.1.2
@@ -39,3 +39,4 @@ 'use strict'; | ||
timeout: requestConfig.timeout, | ||
url: requestConfig.basePath + requestConfig.path | ||
url: requestConfig.basePath + requestConfig.path, | ||
maxRedirects: 0 | ||
}; | ||
@@ -42,0 +43,0 @@ } |
{ | ||
"name": "httplease", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "HTTP client library with support for pluggable filters, including Zipkin, ASAP, etc", | ||
@@ -16,2 +16,3 @@ "main": "index.js", | ||
"request", | ||
"client", | ||
"promise", | ||
@@ -18,0 +19,0 @@ "caching", |
@@ -0,1 +1,3 @@ | ||
 | ||
# Usage guide | ||
@@ -125,2 +127,2 @@ | ||
Copyright (c) 2016 Atlassian and others. | ||
Apache 2.0 licensed, see [LICENSE](LICENSE) file. | ||
Apache 2.0 licensed, see [LICENSE](LICENSE) file. |
'use strict'; | ||
let {willResolve, expectToReject} = require('jasmine-promise-tools'); | ||
let jasminePromiseTools = require('jasmine-promise-tools'); | ||
global.willResolve = willResolve; | ||
global.expectToReject = expectToReject; | ||
global.willResolve = jasminePromiseTools.willResolve; | ||
global.expectToReject = jasminePromiseTools.expectToReject; |
@@ -95,2 +95,19 @@ 'use strict'; | ||
it('does not follow HTTP redirects', willResolve(() => { | ||
httpSpy.getHandler.and.returnValue({ | ||
statusCode: 301, | ||
headers: { | ||
'Location': 'http://invalid' | ||
} | ||
}); | ||
return httpClient | ||
.withPath('/get') | ||
.withMethodGet() | ||
.send() | ||
.then((result) => { | ||
expect(httpSpy.getHandler).toHaveBeenCalled(); | ||
expect(result.status).toBe(301); | ||
}); | ||
})); | ||
}); |
@@ -78,2 +78,3 @@ 'use strict'; | ||
expect(options.responseType).toBe('json'); | ||
expect(options.maxRedirects).toBe(0); | ||
return q.resolve({}); | ||
@@ -80,0 +81,0 @@ }); |
52888
1249
127