Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-45364

Specifying User-Agent using --header is broken in combination with --proxy and --location

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • rhel-9.6
    • rhel-9.4
    • curl
    • None
    • None
    • None
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • 3
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      In image builder we use curl to download rpms. Sometimes this happens from within the VPN, and for certain content we use the squid.corp.redhat.com proxy. Certain content actually redirects, and that's where curl breaks, or rather the proxy as not every proxy can deal with the user agent suddenly changing mid connection.

       

      Please provide the package NVR for which bug is seen:

      curl-7.76.1-29.el9_4

      How reproducible:

      The conditions for this to happen are quite specific:

      1. User agent is set through --header "User-Agent" and not through the --user-agent option
      2. The endpoint that is being curled is https
      3. The endpoint redirects and --location is specified
      4. --proxy is used

      Steps to reproduce

       

      curl --location --proxy squid.corp.redhat.com:3128 --header "User-Agent: foobar" https://google.be

      and compare with

      curl --location --proxy squid.corp.redhat.com:3128 --user-agent "foobar" https://google.be
      

      Expected results

      The user agent is foobar throughout.

      Actual results

      When first connecting via the proxy, the user-agent is "curl/$version", the redirect is done with "foobar", tripping up the proxy.

              jmigacz@redhat.com Jacek Migacz
              sraymaek Sanne Raymaekers
              Jacek Migacz Jacek Migacz
              Daniel Rusek Daniel Rusek
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: