Skip to content

Conversation

@klaernie
Copy link
Contributor

This enables us to enable curl cookie engine by specifying an empty filename as the cookie jar file.

This works, since curl's CURLOPT_COOKIEFILE option allows passing an empty string as filename, which it interprets as a request to enable the cookie processing. But since CURLOPT_COOKIEJAR would now attempt to write to a file named by an empty filename, it would break again (or at least produce a warning in verbose output).

Overall this is allows to handle checking URLs with cookie based sessions without persisting the cookies to disk, by using the curl-internal redirect following.

Copy link
Contributor

@sni sni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable, thanks

@waja waja added this to the 2.4.1 milestone Nov 29, 2024
This enables us to enable curl cookie engine by specifying an empty
filename as the cookie jar file.

This works, since curl's CURLOPT_COOKIEFILE option allows passing an
empty string as filename, which it interprets as a request to enable the
cookie processing. But since CURLOPT_COOKIEJAR would now attempt to
write to a file named by an empty filename, it would break again (or at
least produce a warning in verbose output).

Overall this is allows to handle checking URLs with cookie based
sessions without persisting the cookies to disk, by using the
curl-internal redirect following.
@sni sni merged commit e7dbfd4 into monitoring-plugins:master Dec 2, 2024
7 checks passed
@klaernie klaernie deleted the cookiejar branch December 14, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants