Skip to content

test(device-client): prove the real transport never follows a redirect - #136

Merged
kinqsradio merged 1 commit into
mainfrom
fix/no-redirects-test
Nov 12, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/no-redirects-test

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Summary

  • Test that HttpApi never follows a redirect: a loopback server answers 301, 302, 303, 307 and 308 with a Location to a second loopback listener; GET, POST, PUT and DELETE with a bearer token each come back as the redirect answer, and the second listener sees no connection (the older test redirected to a closed port, which proved nothing).
  • Plain http is refused for any host that is not a loopback IP literal (example.com, localhost, 10.0.0.1, a private port, [2001:db8::1], 127.0.0.1.example.com); loopback http and https are allowed.
  • docs/device-client.md already states that redirects are off; one line added to the tests list.
  • Test only; no behaviour change.

Testing

  • Full gate with Postgres: fmt, clippy, structure, wasm32, workspace tests (993 pass).
  • Mutation: redirect::Policy::default() makes the test fail.
  • Not tested: the CI clippy toolchain (local only).

Co-authors

none

AI usage

  • Written by hand, with no AI
  • Harness and version: Claude Code 2.1.317
  • Models: claude-sonnet-5-5 (all)
  • Effort: medium
  • Human role: set scope (gate follow-up 9)
  • Sources: none

Checklist

  • Works on Windows, macOS and Linux
  • docs/architecture.md with any rule change; generated wire types with any contract change
  • No copied source, secrets, credentials or personal data; no AI attribution in commits, title or branch

A loopback server answers 301, 302, 303, 307 and 308 with a Location to
a second listener. Every method with a bearer token comes back as the
redirect answer and the second listener never gets a connection. Plain
http is also refused for any host that is not a loopback IP literal.
@kinqsradio
kinqsradio merged commit 3873301 into main Nov 12, 2026
17 checks passed
@kinqsradio
kinqsradio deleted the fix/no-redirects-test branch November 12, 2026 08:03
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