Skip to content

curl manual: cross-reference --location-trusted from flag documentation related to specifying authentication #16160

Description

@deliciouslytyped

Specify which documentation you found a problem with

The problem is in the curl manual page up to 8.11.1 assuming https://curl.se/docs/manpage.html is up to date.
This is more a quality-of-life issue than an error.

The problem

It's not entirely obvious on initial inspection why curl isn't forwarding -H "Authorization: ..." (which where manual implies -H is permanent, though presumably curl specifically strips the Authorization header subsequently..) or -u use:pass when following redirects according to -L . The -L documentation does describe the problem and cross references to --location-trusted, but for me it was more intuitive to look under -H and -u when I initially discovered the "missing" authorization headers in -v output.

-H (which is more generic) and -u give no mention of stripping (under redirects).

Activity

  1. deliciouslytyped commented on Feb 4, 2025

    @deliciouslytyped
    Author

    Actually, -H says WARNING: headers set with this option are set in all HTTP requests - even after redirects are followed, like when told with [-L, --location](https://curl.se/docs/manpage.html#-L). This can lead to the header being sent to other hosts than the original host, so sensitive headers should be used with caution combined with following redirects., so it may be a bug after all?

  2. bagder commented on Feb 4, 2025

    @bagder
    Member

    It is on purpose, just not documented properly. I'll do a PR for it.

  3. added a commit that references this issue on Feb 4, 2025
    4add428
  4. deliciouslytyped commented on Feb 4, 2025

    @deliciouslytyped
    Author

    Sorry, I meant documentation bug. Thanks. :)

  5. added a commit that references this issue on Feb 6, 2025
    448e71d
  6. added a commit that references this issue on Apr 26, 2025
    8013b2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions