Skip to content

docs: warn that ip() groups and _method override are not access controls - #10

Merged
muhammetsafak merged 2 commits into
mainfrom
docs/fix-unsafe-examples
Nov 24, 2026
Merged

muhammetsafak merged 2 commits into
mainfrom
docs/fix-unsafe-examples

Conversation

@muhammetsafak

Copy link
Copy Markdown
Contributor

Summary

Documentation-only change: examples that could be copied into an application in an unsafe form are corrected.

  • Document that the client IP comes from Client-IP / X-Forwarded-For before REMOTE_ADDR and must not be used for access control; replace the /debug and /internal examples; correct the Upgrading and Health Checks pages
  • Document that variable_method also applies to GET and that state-changing routes need a CSRF token; mirror both in the README

Notes

  • Only docs/ and README.md change; src/, tests and CI are untouched, and library behavior is unchanged.
  • wiki-sync.sh --check docs passes.

- Document that the client IP comes from `Client-IP` / `X-Forwarded-For` before `REMOTE_ADDR` and must not be used for access control; replace the `/debug` and `/internal` examples; correct the Upgrading and Health Checks pages
- Document that `variable_method` also applies to `GET` and that state-changing routes need a CSRF token; mirror both in the README
- Warn that port() and domain() read the client-supplied Host header
- Replace the /metrics port example
- Put the CSRF token in the main _method form, show the check, and widen the README note
@muhammetsafak
muhammetsafak merged commit 94993b9 into main Nov 24, 2026
8 checks passed
@muhammetsafak
muhammetsafak deleted the docs/fix-unsafe-examples branch November 24, 2026 05:10
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