You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Found this problem while upgrading Jenkins Artifactory plugin from 3.11.0 to 3.11.1. It in turn switches from version 2.26.0 to 2.26.2 of this library.
In 67cefb2 the method downloadArtifactMetaData in DependenciesDownloadHelper is refactored for some reason. Unfortunately the refactoring leads to incorrect handling of HTTP headers. Previously the header name was treated case-insensitively, but after the change it requires a certain case of the header name. If the header name doesn't mach, then, the file isn't downloaded due to the code in downloadArtifact() (which assumes that an artifact is a folder if no md5 or Sha1 is found).
Normally this isn't a problem since Artifactory produces the headers in expected case (X-Checksum-Md5 and X-Checksum-Sha1). But, in our case we have an HAProxy in between which transforms all headers to lower case (due to HTTP2 compliance). And thus the Jenkins Artifactory plugin fails to download the artifacts since the header isn't found by this library.
To be honest I don't see the point in the refactoring done to downloadArtifactMetaData(). The previous implementation relied on HttpResponse#getFirstHeader() to resolve header name to header value, which works perfectly fine. HttpResponse is a well tested and trusted implementation of header handling. Implementing your own header handling is, in my opinion, just unwise!
To Reproduce
Try to download artifacts using this library through a proxy which transforms the response headers to lowercase.
Expected behavior
That this library follows HTTP specification and ignores case of the HTTP response headers.
Versions
2.26.2 of this library
HAProxy 2.2
Additional context
It is possible to work around the issue by setting the following config parameters to HAProxy (i.e. it will ensure the headers have expected format:
Thanks for the quick role out of the fix. Unfortunately we have already deployed the broken version to one of our major Jenkins instances, which isn't scheduled for upgrade/restart for at least a month. So we can't undo workaround for our HAProxy until then. In any case, I will let you know as soon as I have tested it, but it might take a while.
Describe the bug
Found this problem while upgrading Jenkins Artifactory plugin from 3.11.0 to 3.11.1. It in turn switches from version 2.26.0 to 2.26.2 of this library.
In 67cefb2 the method downloadArtifactMetaData in DependenciesDownloadHelper is refactored for some reason. Unfortunately the refactoring leads to incorrect handling of HTTP headers. Previously the header name was treated case-insensitively, but after the change it requires a certain case of the header name. If the header name doesn't mach, then, the file isn't downloaded due to the code in downloadArtifact() (which assumes that an artifact is a folder if no md5 or Sha1 is found).
Normally this isn't a problem since Artifactory produces the headers in expected case (X-Checksum-Md5 and X-Checksum-Sha1). But, in our case we have an HAProxy in between which transforms all headers to lower case (due to HTTP2 compliance). And thus the Jenkins Artifactory plugin fails to download the artifacts since the header isn't found by this library.
To be honest I don't see the point in the refactoring done to downloadArtifactMetaData(). The previous implementation relied on HttpResponse#getFirstHeader() to resolve header name to header value, which works perfectly fine. HttpResponse is a well tested and trusted implementation of header handling. Implementing your own header handling is, in my opinion, just unwise!
To Reproduce
Try to download artifacts using this library through a proxy which transforms the response headers to lowercase.
Expected behavior
That this library follows HTTP specification and ignores case of the HTTP response headers.
Versions
2.26.2 of this library
HAProxy 2.2
Additional context
It is possible to work around the issue by setting the following config parameters to HAProxy (i.e. it will ensure the headers have expected format:
This is not a permanent fix though. This library should really follow the HTTP standard and ignore header case.
The text was updated successfully, but these errors were encountered: