Skip to content
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

Merged
merged 6 commits into from
Mar 13, 2025
Merged

Conversation

MickStein
Copy link
Collaborator

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.

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.
@MickStein MickStein added the bug Something isn't working label Mar 10, 2025
@MickStein MickStein self-assigned this Mar 10, 2025
@MickStein MickStein marked this pull request as ready for review March 12, 2025 13:34
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'
Copy link
Collaborator

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.

Copy link
Collaborator

@Matthew-Collins-Defra Matthew-Collins-Defra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MickStein MickStein merged commit 615bfff into development Mar 13, 2025
1 of 2 checks passed
@MickStein MickStein deleted the bugfix/ltfri-1778 branch March 13, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants