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

Fix maven_artifact.py when your maven is behind a cloudflare #53495

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@pjrm
Copy link
Contributor

pjrm commented Mar 8, 2019

Cloudflare has a feature that checks Browser Integrity Check, when the user agent is not present, it can fail on BIC.

Since we are defining the default value of variable "self.module.params['http_agent']" to None, this will cause that User-Agent header will not be added, because of the conditional if present on module_utils/urls.py [1]

[1] https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/urls.py#L1135-L1136

This fix will ensure that the "self.module.params['http_agent']" will be defined if user_agent is passed through the module

URLs:
https://support.cloudflare.com/hc/en-us/articles/200171806-Error-1010-The-owner-of-this-website-has-banned-your-access-based-on-your-browser-s-signature
https://support.cloudflare.com/hc/en-us/articles/200170086-What-does-the-Browser-Integrity-Check-do-

SUMMARY

This change allows downloading artifacts from a maven installation that's behind Cloudflare.

When User-Agent is not present and try to download from a Cloudflare server that has Browser Integrity Check enabled, it fails.

ISSUE TYPE

BugFix

COMPONENT NAME

maven_artifact.py

ADDITIONAL INFORMATION

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 8, 2019

@pjrm pjrm force-pushed the pjrm:fix_http_agent_cloudflare branch 4 times, most recently from 8fbd294 to ade6fe0 Mar 8, 2019

Fix maven_artifact.py when your maven is behind a cloudflare
Cloudflare has a feature that checks Browser Integrity Check, when the user agent is not present, it can fail on BIC.

Since we are defining the default value of variable "self.module.params['http_agent']" to None, this will cause that
User-Agent header will not be added, because of the conditional if present on module_utils/urls.py [1]

[1] https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/urls.py#L1135-L1136

This fix will ensure that the "self.module.params['http_agent']" will be defined if user_agent is passed through the
module

URLs:
https://support.cloudflare.com/hc/en-us/articles/200171806-Error-1010-The-owner-of-this-website-has-banned-your-access-based-on-your-browser-s-signature
https://support.cloudflare.com/hc/en-us/articles/200170086-What-does-the-Browser-Integrity-Check-do-

@pjrm pjrm force-pushed the pjrm:fix_http_agent_cloudflare branch from ade6fe0 to aed4a9b Mar 8, 2019

@turb

This comment has been minimized.

Copy link
Contributor

turb commented Mar 13, 2019

lgtm

@ansibot ansibot removed the needs_triage label Mar 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.