Skip to content

Fix --from-curl redirect handling to match curl semantics#519

Merged
ryanfowler merged 1 commit into
mainfrom
fix-curl-redirect-semantics
May 12, 2026
Merged

Fix --from-curl redirect handling to match curl semantics#519
ryanfowler merged 1 commit into
mainfrom
fix-curl-redirect-semantics

Conversation

@ryanfowler
Copy link
Copy Markdown
Owner

Summary

  • Make --from-curl disable redirects unless curl passed -L/--location.
  • Use curl’s default redirect limit of 50 when -L is present and --max-redirs is omitted.
  • Preserve explicit --max-redirs values, including 0 and -1, by tracking whether the flag was set.
  • Add CLI and curl parser coverage for the redirect cases.

Testing

  • Added unit tests for --from-curl redirect translation in internal/cli.
  • Added parser coverage for explicit --max-redirs values in internal/curl.
  • Verified with go test ./....

@ryanfowler ryanfowler enabled auto-merge May 12, 2026 01:16
@ryanfowler ryanfowler merged commit 9ee259f into main May 12, 2026
10 checks passed
@ryanfowler ryanfowler deleted the fix-curl-redirect-semantics branch May 12, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant