Bug 1472847 - dnf install dosn't handle 'Location:' http header
Summary: dnf install dosn't handle 'Location:' http header
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 26
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jaroslav Mracek
QA Contact: Fedora Extras Quality Assurance
Keywords: Triaged
Depends On:
TreeView+ depends on / blocked
Reported: 2017-07-19 14:01 UTC by jniederm
Modified: 2017-10-10 19:30 UTC (History)
6 users (show)

Clone Of:
Last Closed: 2017-10-08 08:27:36 UTC

Attachments (Terms of Use)

Description jniederm 2017-07-19 14:01:06 UTC
Description of problem:
When installing a package from http location, `dnf install` doesn't handle http redirection expressed by 'Location:' http header.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. dnf install https://atom.io/download/rpm

Actual results:
Last metadata expiration check: 0:06:52 ago on Wed Jul 19 13:04:23 2017.
No package https://atom.io/download/rpm available.
Error: Unable to find a match

Expected results:
package is offered for installation with resolved dependencies

Additional info:
it works with manually resolver url: dnf install 'https://atom-installer.github.com/v1.18.0/atom.x86_64.rpm?s=1497483731&ext=.rpm'

$ http https://atom.io/download/rpmHTTP/1.1 302 Found
Cache-Control: no-cache
Connection: close
Content-Security-Policy: default-src 'self'; connect-src 'self'; font-src https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src 'self' https://www.youtube.com; img-src https://* 'self' https://github-atom-io-herokuapp-com.global.ssl.fastly.net data:; media-src 'self'; object-src 'self' https://github-atom-io-herokuapp-com.global.ssl.fastly.net; script-src 'self' 'unsafe-inline' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.global.ssl.fastly.net; style-src 'self' 'unsafe-inline' https://github-atom-io-herokuapp-com.global.ssl.fastly.net;
Content-Type: text/html; charset=utf-8
Date: Wed, 19 Jul 2017 13:59:35 GMT
Location: https://atom-installer.github.com/v1.18.0/atom.x86_64.rpm?s=1497483731&ext=.rpm
Server: Cowboy
Status: 302 Found
Strict-Transport-Security: max-age=631152000
Via: 1.1 vegur
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Rack-Cache: miss
X-Request-Id: bba84816-1ddb-4432-94cc-82a3026ba699
X-Runtime: 0.006117
X-Xss-Protection: 1; mode=block

<html><body>You are being <a href="https://atom-installer.github.com/v1.18.0/atom.x86_64.rpm?s=1497483731&amp;ext=.rpm">redirected</a>.</body></html>

$ http 'https://atom-installer.github.com/v1.18.0/atom.x86_64.rpm?s=1497483731&ext=.rpm'
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: keep-alive
Content-Length: 128551353
Content-Type: application/octet-stream
Date: Wed, 19 Jul 2017 14:00:01 GMT
ETag: "330658dca5740290e461a617386625cc-25"
Last-Modified: Wed, 14 Jun 2017 23:42:14 GMT
Server: AmazonS3
Via: 1.1 varnish
X-Cache: HIT
X-Cache-Hits: 0
X-Served-By: cache-ams4447-AMS
X-Timer: S1500472801.280472,VS0,VE1
x-amz-id-2: dqwCDVYxHQ8pGEOJVs2VW3bfz9aKf3AEAD4FyZzvADX/lwl7zeTovW317zkqkNjuZR8F2ZEeDsQ=
x-amz-request-id: E0E279692A01927C

| NOTE: binary data not shown in terminal |

Comment 1 Jaroslav Mracek 2017-07-24 19:25:54 UTC
What If I will note that dnf handles argument like that only arguments that end up with ".rpm" are recognized as rpm file. The rest is handled as NEVRA, provide or file provide.

Comment 2 Jaroslav Mracek 2017-08-15 16:06:43 UTC
I created a patch that should solve reported problem (https://github.com/rpm-software-management/dnf/pull/898). Thanks for report.

Comment 3 Fedora Update System 2017-10-06 15:58:48 UTC
dnf-2.7.3-1.fc27 dnf-plugins-core-2.1.5-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-bb3b9775cc

Comment 4 Fedora Update System 2017-10-06 15:59:09 UTC
dnf-2.7.3-1.fc26 dnf-plugins-core-2.1.5-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0f2730a8c2

Comment 5 Fedora Update System 2017-10-08 06:23:27 UTC
dnf-2.7.3-1.fc27, dnf-plugins-core-2.1.5-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-bb3b9775cc

Comment 6 Fedora Update System 2017-10-08 08:27:36 UTC
dnf-2.7.3-1.fc26, dnf-plugins-core-2.1.5-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2017-10-10 19:30:21 UTC
dnf-2.7.3-1.fc27, dnf-plugins-core-2.1.5-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.