Skip to content

setopt: allow setting a referer from CURLINFO_REFERER - #22709

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/referer
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/referer

Conversation

@bagder

@bagder bagder commented Aug 27, 2026

Copy link
Copy Markdown
Member

Reported-by: Stanislav Fort

Verified by test 2397

Reported-by: Stanislav Fort

Verified by test 2397
@github-actions github-actions Bot added the tests label Aug 27, 2026
@bagder
bagder marked this pull request as ready for review August 27, 2026 11:48
@bagder
bagder requested a balanced review from Copilot August 27, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Allows CURLOPT_REFERER to safely reuse a pointer returned by CURLINFO_REFERER.

Changes:

  • Delays freeing the existing referer until after copying the new value.
  • Adds regression test 2397 and registers it.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/setopt.c Safely replaces the referer value.
tests/libtest/lib2397.c Exercises referer pointer reuse.
tests/data/test2397 Defines redirect test behavior.
tests/libtest/Makefile.inc Registers the test source.
tests/data/Makefile.am Registers test 2397.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/setopt.c Outdated
Comment thread tests/libtest/lib2397.c
language

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bagder bagder closed this in d024768 Aug 27, 2026
@bagder
bagder deleted the bagder/referer branch August 27, 2026 12:27
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