Skip to content

Commit faf85e4

Browse files
committed
Add custom http header
1 parent 2774100 commit faf85e4

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

example-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24client-example-web",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "NIP24 Client for Javascript - web browser example",
55
"author": "",
66
"license": "Apache-2.0",

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24client-example",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "NIP24 Client for Javascript - node.js example",
55
"author": "",
66
"license": "Apache-2.0",

lib/nip24client.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const VATStatus = require('./vatstatus');
4848
const WLStatus = require('./wlstatus');
4949

5050

51-
NIP24Client.prototype.VERSION = '1.3.2';
51+
NIP24Client.prototype.VERSION = '1.3.3';
5252

5353
NIP24Client.prototype.PRODUCTION_URL = 'https://www.nip24.pl/api';
5454
NIP24Client.prototype.TEST_URL = 'https://www.nip24.pl/api-test';
@@ -159,11 +159,14 @@ function userAgent(nip24)
159159
*/
160160
function get(nip24, url)
161161
{
162+
const agent = userAgent(nip24);
163+
162164
return maxios.get(url, {
163165
headers: {
164166
'Accept': 'application/xml',
165167
'Authorization': auth(nip24, 'GET', url),
166-
'User-Agent': userAgent(nip24)
168+
'User-Agent': agent,
169+
'X-NIP24-Client': agent
167170
}
168171
}).then(response => {
169172
return new mxmldom.DOMParser().parseFromString(response.data);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24client",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "NIP24 Client for JavaScript",
55
"keywords": [
66
"nip24",

0 commit comments

Comments
 (0)