add user-agent header to template downloader request#12791
add user-agent header to template downloader request#12791sudo87 wants to merge 2 commits intoapache:4.22from
Conversation
|
@blueorangutan package |
|
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12791 +/- ##
============================================
- Coverage 17.61% 17.60% -0.01%
+ Complexity 15664 15657 -7
============================================
Files 5917 5917
Lines 531402 531415 +13
Branches 64971 64972 +1
============================================
- Hits 93596 93579 -17
- Misses 427252 427281 +29
- Partials 10554 10555 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 17096 |
|
@sudo87 any linked issue ? |
core/src/main/java/com/cloud/storage/template/HttpTemplateDownloader.java
Outdated
Show resolved
Hide resolved
@weizhouapache it seems no linked issue for this. |
|
@sudo87 check if the user-agent update is relavent in createRequest() at MetalinkTemplateDownloader, SimpleHttpMultiFileDownloader, HttpDirectTemplateDownloader. |
Thanks @sureshanaparti for your feedback on the pr. I think there is no harm adding user-agent in the GetMethod request, updated the pr accordingly. |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17116 |
|
@blueorangutan test |
|
@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15638)
|
vishesh92
left a comment
There was a problem hiding this comment.
The code looks good. My only concern (not sure about the impact) is the value for the user agent. We should ensure it matches the format as per the RFC. below is the output from quick web search.
Ref:
https://www.rfc-editor.org/rfc/rfc9110.html#section-10.1.5
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent
Description
This PR adds user-agent header to download request.
Some template providers reject HTTP requests without a User-Agent
header and return HTTP 403 instead of redirecting to the actual
download location. This causes template downloads to fail.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?