Skip to content

Commit 5c67776

Browse files
committed
Made UA into const.
1 parent 5fdb42c commit 5c67776

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/util.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ if (config.http_proxy) {
1414
agent: new HttpsProxyAgent(config.http_proxy)
1515
})
1616
}
17-
17+
const customUaHeader = 'hapi-wreck/18 (cyltfr-app)'
1818
const { performance } = require('node:perf_hooks')
1919
const get = (url, options = {}, ext = false) => {
2020
const thisWreck = (ext && wreckExt) ? wreckExt : wreck
2121
const startTick = performance.now()
2222
// Header with UA added for AWS WAF as it is required, otherwise it will block the request
2323
options.headers = {
2424
...options.headers,
25-
'User-Agent': 'hapi-wreck/18 (cyltfr-app)'
25+
'User-Agent': customUaHeader
2626
}
2727

2828
return thisWreck.get(url, options)
@@ -50,7 +50,7 @@ const post = (url, options = {}, ext = false) => {
5050
// Header with UA added for AWS WAF as it is required, otherwise it will block the request
5151
options.headers = {
5252
...options.headers,
53-
'User-Agent': 'hapi-wreck/18 (cyltfr-app)'
53+
'User-Agent': customUaHeader
5454
}
5555

5656
return thisWreck.post(url, options)

0 commit comments

Comments
 (0)