Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix maven_artifact.py when your maven is behind a cloudflare #53495
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 
This fix will ensure that the "self.module.params['http_agent']" will be defined if user_agent is passed through the module
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.