Branch: refs/heads/master Home: https://github.com/jenkinsci/apache-httpcomponents-client-4-api-plugin Commit: 7b30b98be0be9d60cf151a3bbad255ce50ecabc5 https://github.com/jenkinsci/apache-httpcomponents-client-4-api-plugin/commit/7b30b98be0be9d60cf151a3bbad255ce50ecabc5 Author: Robin Verduijn <robinverduijn.git...@gmail.com> Date: 2019-10-02 (Wed, 02 Oct 2019)
Changed paths: M src/main/java/io/jenkins/plugins/httpclient/RobustHTTPClient.java Log Message: ----------- Enhance uploadFile so that it optionally sets a "Content-Type" header. In order to fix JENKINS-50772, it is necessary to specify the "Content-Type" header when uploading files. In this commit, we change RobustHTTPClient to accept a content type parameter for an uploaded file. This is a prerequisite for further changes on the artifact-manager-s3 side, where the content type is determined and then passed in to the AWS signed URL generation code. In order to work with those signed URLs which include a content type header, we also need to ensure the upload code specifies the same header when uploading the file. The existing RobustHTTPClient `uploadFile(File, URL, TaskListener)` method signature is preserved, and changed to call the new `uploadFile(File, String, URL, TaskListener)` which includes an additional parameter for specifying the content type. If this is non-null, the "Content-Type" HTTP header will be set accordingly. This is necessary, or the presigned URL which included the "Content-Type" header, and the `GET` request used to perform the upload do not match and will throw an AWS exception complaining that "The request signature we calculated does not match the signature you provided." Signed-off-by: Robin Verduijn <robinverduijn.git...@gmail.com> Commit: 2d2a3c92020f78186f020c0f30af383d751e11bb https://github.com/jenkinsci/apache-httpcomponents-client-4-api-plugin/commit/2d2a3c92020f78186f020c0f30af383d751e11bb Author: Robin Verduijn <robinverduijn.git...@gmail.com> Date: 2019-10-04 (Fri, 04 Oct 2019) Changed paths: M src/main/java/io/jenkins/plugins/httpclient/RobustHTTPClient.java Log Message: ----------- Add Javadoc for the newly added `uploadFile` method. Signed-off-by: Robin Verduijn <robinverduijn.git...@gmail.com> Commit: 1d7381504cfe41765318c9a825c63379184fe36b https://github.com/jenkinsci/apache-httpcomponents-client-4-api-plugin/commit/1d7381504cfe41765318c9a825c63379184fe36b Author: Oleg Nenashev <o.v.nenas...@gmail.com> Date: 2019-10-05 (Sat, 05 Oct 2019) Changed paths: M src/main/java/io/jenkins/plugins/httpclient/RobustHTTPClient.java Log Message: ----------- Merge pull request #24 from robinverduijn/JENKINS-50772-set-s3-content-type JENKINS-50772: Enhance uploadFile so that it optionally sets a "Content-Type" header. Compare: https://github.com/jenkinsci/apache-httpcomponents-client-4-api-plugin/compare/60593aa39ee8...1d7381504cfe -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/apache-httpcomponents-client-4-api-plugin/push/refs/heads/master/60593a-1d7381%40github.com.