-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.46.2
S3 Plugin 0.10.12
AWS SDK 1.11.119
Using the following to upload a JSON file to S3 results in the Metadata Content-Type to be set to application/octet-stream
step([$class: 'S3BucketPublisher', consoleLogLevel: 'INFO', dontWaitForConcurrentBuildCompletion: false, entries: [[ bucket: 'x.x.tech', excludedFile: '', flatten: false, gzipFiles: false, keepForever: true, managedArtifacts: false, noUploadOnFailure: true, selectedRegion: 'eu-west-1', showDirectlyInBrowser: false, sourceFile: "path/**", storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: true ]], pluginFailureResultConstraint: 'FAILURE', profileName: 'x-profile', userMetadata: []])
However we'd like to set the Content-Type to application/json. I've had a look around and seen nothing, but looking in the code I see that this should be set automatically, Is there something I'm missing for this to be set correctly?
Hi garfty
You need to do "showDirectlyInBrowser: true" - in this case everything should be ok. Maybe setting `userMedata` to "ContentType: application/json" will be required.
To be honest I don't know reason behind setting "application/octet-stream" by default. But I believe that it was done on purpose