-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Querying flood warnings and alerts broken #155
Conversation
https://eaflood.atlassian.net/browse/LTFRI-1778 Due to changes to how the rest api calls work on AWS via the WAF, the WAF is blocking REST calls without a user agent header. We need to add a user agent header to the REST calls so that this call no longer fails.
server/util.js
Outdated
// Header with UA added for AWS WAF as it is required, otherwise it will block the request | ||
options.headers = { | ||
...options.headers, | ||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a constant declared at the top of the file. And it should be something like
hapi-wreck/18 (cyltfr-app)
so we're not pretending to be something we're not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
https://eaflood.atlassian.net/browse/LTFRI-1778
Due to changes to how the rest api calls work on AWS via the WAF, the WAF is blocking REST calls without a user agent header.
We need to add a user agent header to the REST calls so that this call no longer fails.