@bbc/http-transport
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -70,2 +70,6 @@ 'use strict'; | ||
getRequestKey() { | ||
return `${this.getMethod()}:${this.getUrl()}`; | ||
} | ||
getHeaders() { | ||
@@ -72,0 +76,0 @@ return this._headers; |
{ | ||
"name": "@bbc/http-transport", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "A flexible, modular REST client built for ease-of-use and resilience.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -74,2 +74,17 @@ 'use strict'; | ||
}); | ||
describe('.getRequestKey', () => { | ||
it('returns a cacheable key for a request', () => { | ||
const request = Request.create(); | ||
request | ||
.method('GET') | ||
.baseUrl(HOST) | ||
.addQuery('a', 1) | ||
.addQuery('b', 2); | ||
const key = `GET:${HOST}?a=1&b=2`; | ||
assert.equal(request.getRequestKey(), key); | ||
}); | ||
}); | ||
}); |
376612
6820