Skip to content

tool_getparam: stop supporting @filename style for --cookie#12645

Closed
jay wants to merge 1 commit intocurl:masterfrom
jay:cookie_optval_style
Closed

tool_getparam: stop supporting @filename style for --cookie#12645
jay wants to merge 1 commit intocurl:masterfrom
jay:cookie_optval_style

Conversation

@jay
Copy link
Copy Markdown
Member

@jay jay commented Jan 7, 2024

The @filename style was never documented for --cookie <data|filename> but prior to this change curl would accept it anyway and always treat a @ prefixed string as a filename.

That's a problem if the string also contains a = sign because then it is documented to be interpreted as a cookie string and not a filename.

Example:

--cookie @foo=bar

Before: Interpreted as load cookies from filename foo=bar.

After: Interpreted as cookie @foo=bar (name @foo and value bar).

Other curl options with a data/filename option-value use the @filename to distinguish filenames which is probably how this happened. The --cookie option has never been documented that way.

Ref: https://curl.se/docs/manpage.html#-b

Closes #xxxx

The `@filename` style was never documented for --cookie <data|filename>
but prior to this change curl would accept it anyway and always treat a
@ prefixed string as a filename.

That's a problem if the string also contains a = sign because then it is
documented to be interpreted as a cookie string and not a filename.

Example:

`--cookie @foo=bar`

Before: Interpreted as load cookies from filename foo=bar.

After: Interpreted as cookie `@foo=bar` (name `@foo` and value `bar`).

Other curl options with a data/filename option-value use the `@filename`
to distinguish filenames which is probably how this happened. The
--cookie option has never been documented that way.

Ref: https://curl.se/docs/manpage.html#-b

Closes #xxxx
@jay jay force-pushed the cookie_optval_style branch from 7d8f835 to 820c0a4 Compare January 16, 2024 08:34
@jay jay closed this in f4606a7 Jan 17, 2024
@jay jay deleted the cookie_optval_style branch January 17, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants