[RTFACT-14802] Different content type when upload apk file to Bintray via Distribution repository Created: 16/Aug/17  Updated: 05/Nov/18

Status: Open
Project: Artifactory Binary Repository
Component/s: Distribution Repository
Affects Version/s: 4.11.0, 5.4.6
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Batel Tova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When you deploying apk file to Bintray via the UI the content type will be :
< Content-Type: application/vnd.android.package-archive
As the following snippet :

batelt@batelt-mac:~/Desktop/bintray$ curl -X HEAD -I -L -ubatelt222:3d5828f87d29cd734c2178745126cac1cbf48474 "https://batelnew2.bintray.com/maven/com/hl/android-gcd/0.1.5/android-gcd-0.1.5.apk" -o android-gcd-0.1.5.apk -Lvv :
Note: Unnecessary use of -X or --request, HEAD is already inferred.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 159.122.18.156...
* TCP_NODELAY set
* Connected to batelnew2.bintray.com (159.122.18.156) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.bintray.com
* Server certificate: GeoTrust SSL CA - G3
* Server certificate: GeoTrust Global CA
* Server auth using Basic with user 'batelt222'
> HEAD /maven/com/hl/android-gcd/0.1.5/android-gcd-0.1.5.apk HTTP/1.1
> Host: batelnew2.bintray.com
> Authorization: Basic YmF0ZWx0MjIyOjNkNTgyOGY4N2QyOWNkNzM0YzIxNzg3NDUxMjZjYWMxY2JmNDg0NzQ=
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 16 Aug 2017 12:30:51 GMT
{color:#d04437}< Content-Type: application/vnd.android.package-archive
{color}< Content-Length: 15064258
< Connection: keep-alive
< Content-Disposition: attachment; filename="android-gcd-0.1.5.apk"
< Last-Modified: Wed, 16 Aug 2017 04:47:16 GMT
< Cache-Control: max-age=30, must-revalidate
< ETag: 605dd463f836f30f552c49d8f2ca443ef10a7b5ca7001bcb1a063579eedaf68e
< X-Checksum-Sha1: 0ded554baca8528a70687625271e4dcb16fe004d
< X-Checksum-Sha2: 605dd463f836f30f552c49d8f2ca443ef10a7b5ca7001bcb1a063579eedaf68e
< Accept-Ranges: bytes
<
* Curl_http_done: called premature == 0
  0 14.3M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host batelnew2.bintray.com left intact

On the other hand when uploading the same apk file via Artifactory with Distribution repo we are getting the following content type :

< Content-Type: application/octet-stream

As the following snippet :

batelt@batelt-mac:~/Desktop/bintray$ curl -X HEAD -I -L -ubatelt222:3d5828f87d29cd734c2178745126cac1cbf48474 "https://batelnew2.bintray.com/maven/com/hl/android-gcd/0.1.4/android-gcd-0.1.4.apk" -o android-gcd-0.1.4.apk -Lvv
Note: Unnecessary use of -X or --request, HEAD is already inferred.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 159.122.18.156...
* TCP_NODELAY set
* Connected to batelnew2.bintray.com (159.122.18.156) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.bintray.com
* Server certificate: GeoTrust SSL CA - G3
* Server certificate: GeoTrust Global CA
* Server auth using Basic with user 'batelt222'
> HEAD /maven/com/hl/android-gcd/0.1.4/android-gcd-0.1.4.apk HTTP/1.1
> Host: batelnew2.bintray.com
> Authorization: Basic YmF0ZWx0MjIyOjNkNTgyOGY4N2QyOWNkNzM0YzIxNzg3NDUxMjZjYWMxY2JmNDg0NzQ=
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 302
< Server: nginx
< Date: Wed, 16 Aug 2017 12:30:44 GMT
< Content-Length: 0
< Connection: keep-alive
< Location: https://akamai.bintray.com/60/605dd463f836f30f552c49d8f2ca443ef10a7b5ca7001bcb1a063579eedaf68e?__gda__=exp=1502887364~hmac=80166dbbe1a153240e6c344c87664353cc1143043c00d341d8395a50d2b39d7a&response-content-disposition=attachment%3Bfilename%3D%22android-gcd-0.1.4.apk%22&response-content-type=application%2Foctet-stream&requestInfo=U2FsdGVkX19p-lWX3fHvTnjLSaT7jjbHn4v7X4-sv7SeR-R7mUgakupg0Px4PShB_0rVyPOzyZ9Aht9T4HPa5d9o5-vHyXEaxpLiAvUcKKKNMhRr_dlHM-2BkbsvoB_v70ENAnVe37Luxuwt8CCh8pXUqbkLsV_EPamr9g-6fsI
<
* Curl_http_done: called premature == 0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host batelnew2.bintray.com left intact
* Issue another request to this URL: 'https://akamai.bintray.com/60/605dd463f836f30f552c49d8f2ca443ef10a7b5ca7001bcb1a063579eedaf68e?__gda__=exp=1502887364~hmac=80166dbbe1a153240e6c344c87664353cc1143043c00d341d8395a50d2b39d7a&response-content-disposition=attachment%3Bfilename%3D%22android-gcd-0.1.4.apk%22&response-content-type=application%2Foctet-stream&requestInfo=U2FsdGVkX19p-lWX3fHvTnjLSaT7jjbHn4v7X4-sv7SeR-R7mUgakupg0Px4PShB_0rVyPOzyZ9Aht9T4HPa5d9o5-vHyXEaxpLiAvUcKKKNMhRr_dlHM-2BkbsvoB_v70ENAnVe37Luxuwt8CCh8pXUqbkLsV_EPamr9g-6fsI'
*   Trying 72.247.86.156...
* TCP_NODELAY set
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to akamai.bintray.com (72.247.86.156) port 443 (#1)
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.bintray.com
* Server certificate: Symantec Class 3 Secure Server CA - G4
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> HEAD /60/605dd463f836f30f552c49d8f2ca443ef10a7b5ca7001bcb1a063579eedaf68e?__gda__=exp=1502887364~hmac=80166dbbe1a153240e6c344c87664353cc1143043c00d341d8395a50d2b39d7a&response-content-disposition=attachment%3Bfilename%3D%22android-gcd-0.1.4.apk%22&response-content-type=application%2Foctet-stream&requestInfo=U2FsdGVkX19p-lWX3fHvTnjLSaT7jjbHn4v7X4-sv7SeR-R7mUgakupg0Px4PShB_0rVyPOzyZ9Aht9T4HPa5d9o5-vHyXEaxpLiAvUcKKKNMhRr_dlHM-2BkbsvoB_v70ENAnVe37Luxuwt8CCh8pXUqbkLsV_EPamr9g-6fsI HTTP/1.1
> Host: akamai.bintray.com
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< ETag: "6e139cc5dc4abd0a1fe53b9915ff2fb4:1502858662.244764"
< Last-Modified: Wed, 16 Aug 2017 04:40:55 GMT
< Server: AkamaiNetStorage
< Content-Length: 15064258
< Date: Wed, 16 Aug 2017 12:30:46 GMT
< Connection: keep-alive
{color:#d04437}< Content-Type: application/octet-stream
{color}< content-disposition: attachment;filename="android-gcd-0.1.4.apk"
<
* Curl_http_done: called premature == 0
  0 14.3M    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0

*Steps to reproduce :
*

Bintray upload :

  1. Create Bintray Maven repository
  2. Upload the file via the ui
  3. Download the file via curl command with headers (HEAD -I)
  4. The content type will be "application/vnd.android.package-archive"
    y
    Artifactory upload :
  5. Create a new Distribution repository and Maven repository
  6. Upload the apk file to maven repository
  7. Distribute the file from Artifactory to Bintray
  8. Download the file via curl command with headers (HEAD -I)
  9. The content type will be "application/octet-stream"

Generated at Tue Dec 10 09:31:25 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.