Bug 1211662

Summary: Empty headers set by LRO_HTTPHEADER sometimes vanish
Product: [Fedora] Fedora Reporter: Michael Mráka <mmraka>
Component: librepoAssignee: amatej
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: amatej, dmach, lpramuk, tmlcoch
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-16 11:40:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Mráka 2015-04-14 14:21:49 UTC
Description of problem:
Empty http header set via 
handler.setopt(librepo.LRO_HTTPHEADER, "X-Empty;")
is sent to server only on first use of handler and forgotten on next use.

Version-Release number of selected component (if applicable):
librepo-1.7.15-1.fc23.x86_64

How reproducible:
always


Additional info:
It works if I use workaround
handler.setopt(librepo.LRO_HTTPHEADER, "X-Empty: \nX-libcurl-Empty-Header-Workaround: *")

Comment 1 Jan Kurik 2015-07-15 14:16:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 2 Fedora End Of Life 2016-11-24 11:41:58 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Michael Mráka 2016-11-25 09:17:07 UTC
Still valid.

Comment 4 Lukas Pramuk 2017-02-15 15:59:29 UTC
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1422518 shows that httpd turned/turns intolerant against one single LF sent in header 

So workaround recommended in comment#0 is now useless.

Comment 5 Michael Mráka 2017-02-16 09:55:10 UTC
> So workaround recommended in comment#0 is now useless.

Well, according to it the workaround now should be
handler.setopt(librepo.LRO_HTTPHEADER, "X-Empty: \r\nX-libcurl-Empty-Header-Workaround: *")

Comment 6 Fedora End Of Life 2017-02-28 09:42:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 7 Fedora End Of Life 2018-05-03 08:51:42 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 8 Michael Mráka 2018-05-03 09:17:09 UTC
Still valid.

Comment 9 Jan Kurik 2018-08-14 10:23:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 10 amatej 2019-08-15 12:56:18 UTC
Can you be more specific about how to reproduce the problem?

I tried inserting:
h.setopt(librepo.LRO_HTTPHEADER, ["X-Empty;"])
into https://github.com/rpm-software-management/librepo/blob/master/examples/python/download_remote_yum_repo.py (and also changing the invalid repository URL)
which has two calls to perform on the handle but every GET request I saw with tcpdump had the X-Empty header part.

Comment 11 Michael Mráka 2019-08-16 11:40:14 UTC
Well, yes, it finally seems  to work in rawhide.

Most likely due to this fix in libcurl
https://github.com/curl/curl/commit/8123560d4496992baecc0c7a05e56ce48e6b6273