Skip to content

fix: keep {{variables}} whole in the request line - #18

Merged
AustinMusiku merged 1 commit into
masterfrom
fix-request-line-vars
Nov 10, 2026
Merged

AustinMusiku merged 1 commit into
masterfrom
fix-request-line-vars

Conversation

@AustinMusiku

Copy link
Copy Markdown
Owner

A request line in a .http file was split into words before its variables were filled in. Any {{...}} with a space inside it broke the line:

POST {{$processEnv AUTH_URL}}/login
flow.http:1: want "METHOD URL", got 3 words

{{ name }}, with spaces inside the braces, failed the same way. run --help advertises {{$processEnv NAME}}, and an agent using timeline hit this and had to switch to {{NAME}} instead.

The fix

  • requestLine splits the line with a small regex (word) that keeps each {{...}} whole, in place of strings.Fields. Variables are still filled in after the split, as before.
  • Headers, ?/& continuation lines and bodies weren't affected, since they're filled in before anything splits them.
  • An unclosed {{ falls back to splitting on spaces, as strings.Fields did.

Tests

TestParseHTTPVariables gains a request line with both forms: POST {{$processEnv HOST_URL}}/{{ version }} HTTP/1.1. It failed before the change (got 5 words) and passes now.

Tested with go test -race ./.... The built binary also sent POST {{$processEnv AUTH_URL}}/login HTTP/1.1 to a local server.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 12:22

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@AustinMusiku
AustinMusiku merged commit a391afc into master Nov 10, 2026
1 check passed
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.

2 participants