From 604786c5d812b56279c1181231fc6e91ea36cc95 Mon Sep 17 00:00:00 2001 From: Diogo Martins Date: Sat, 14 Feb 2026 15:53:29 +0000 Subject: [PATCH 1/2] Fix Caddy, improve AGENTS.md for external AI contributions --- AGENTS.md | 35 +++++++++++++++++++++++++++++- CHANGELOG.md | 3 ++- docs/content/servers/caddy.md | 23 ++++++++++++++++++++ src/Servers/CaddyServer/Caddyfile | 16 ++++++++++++++ src/Servers/CaddyServer/Dockerfile | 1 + src/Servers/CaddyServer/body.html | 1 + 6 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 src/Servers/CaddyServer/body.html diff --git a/AGENTS.md b/AGENTS.md index 8189162..72993a7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -247,7 +247,7 @@ After making all changes: ## TASK B: Add a new framework -Adding a framework requires creating **3 files** in a new directory. No existing files need modification. +Adding a framework requires creating **3 files** in a new directory, plus a **documentation page** on the website. ### Step 1 — Create the server directory @@ -302,6 +302,39 @@ Create `src/Servers/YourServer/probe.json` with exactly one field: This name appears in the leaderboard and PR comments. +### Step 5 — Create the server documentation page + +**File:** `docs/content/servers/{server-name-lowercase}.md` + +Use this template: + +```markdown +--- +title: "Server Name" +toc: false +breadcrumbs: false +--- + +**Language:** Language · [View source on GitHub](https://github.com/MDA2AV/Http11Probe/tree/main/src/Servers/YourServer) + +## Dockerfile + +\```dockerfile +[Complete Dockerfile contents] +\``` + +## Source — `filename.ext` + +\```language +[Complete source file contents] +\``` +``` + +Rules: +- Include one `## Source — \`filename\`` section per source file (exclude `probe.json`). +- Use the correct syntax-highlight language for each code block (e.g., `python`, `javascript`, `text`, `html`). +- The Dockerfile section always comes first, followed by source files. + ### Verification checklist 1. Build the Docker image: `docker build -f src/Servers/YourServer/Dockerfile -t yourserver .` diff --git a/CHANGELOG.md b/CHANGELOG.md index b4f755c..78c6de6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,10 @@ All notable changes to Http11Probe are documented in this file. - `COMP-CONTENT-TYPE` — response with content should include Content-Type (RFC 9110 §8.3, SHOULD) ### Changed -- **AGENTS.md** — added Step 5 (RFC Requirement Dashboard) to the "Add a new test" task +- **AGENTS.md** — added Step 5 (RFC Requirement Dashboard) to the "Add a new test" task; added Step 5 (server documentation page) to the "Add a framework" task - **RFC Requirement Dashboard** — updated with all 9 new tests, counts, and cross-references - **Landing page cards** — removed hardcoded test count from RFC Requirement Dashboard subtitle +- **Caddy server** — fixed POST body echo using Caddy Parrot pattern; updated Caddyfile, Dockerfile, and docs page ## [2026-02-14] diff --git a/docs/content/servers/caddy.md b/docs/content/servers/caddy.md index e323e69..e5b52b1 100644 --- a/docs/content/servers/caddy.md +++ b/docs/content/servers/caddy.md @@ -11,6 +11,7 @@ breadcrumbs: false ```dockerfile FROM caddy:2 COPY src/Servers/CaddyServer/Caddyfile /etc/caddy/Caddyfile +COPY src/Servers/CaddyServer/body.html /srv/body.html COPY src/Servers/CaddyServer/echo.html /srv/echo.html ``` @@ -18,6 +19,21 @@ COPY src/Servers/CaddyServer/echo.html /srv/echo.html ```text :8080 { + request_body { + max_size 1MB + } + + @post_root { + method POST + path / + } + handle @post_root { + root * /srv + templates + rewrite * /body.html + file_server + } + handle /echo { root * /srv templates { @@ -26,10 +42,17 @@ COPY src/Servers/CaddyServer/echo.html /srv/echo.html rewrite * /echo.html file_server } + respond "OK" 200 } ``` +## Source — `body.html` + +```html +{{- placeholder "http.request.body" -}} +``` + ## Source — `echo.html` ```html diff --git a/src/Servers/CaddyServer/Caddyfile b/src/Servers/CaddyServer/Caddyfile index 2134c83..daf76e0 100644 --- a/src/Servers/CaddyServer/Caddyfile +++ b/src/Servers/CaddyServer/Caddyfile @@ -1,4 +1,19 @@ :8080 { + request_body { + max_size 1MB + } + + @post_root { + method POST + path / + } + handle @post_root { + root * /srv + templates + rewrite * /body.html + file_server + } + handle /echo { root * /srv templates { @@ -7,5 +22,6 @@ rewrite * /echo.html file_server } + respond "OK" 200 } diff --git a/src/Servers/CaddyServer/Dockerfile b/src/Servers/CaddyServer/Dockerfile index 729486b..6227bfa 100644 --- a/src/Servers/CaddyServer/Dockerfile +++ b/src/Servers/CaddyServer/Dockerfile @@ -1,3 +1,4 @@ FROM caddy:2 COPY src/Servers/CaddyServer/Caddyfile /etc/caddy/Caddyfile +COPY src/Servers/CaddyServer/body.html /srv/body.html COPY src/Servers/CaddyServer/echo.html /srv/echo.html diff --git a/src/Servers/CaddyServer/body.html b/src/Servers/CaddyServer/body.html new file mode 100644 index 0000000..d722472 --- /dev/null +++ b/src/Servers/CaddyServer/body.html @@ -0,0 +1 @@ +{{- placeholder "http.request.body" -}} \ No newline at end of file From 82033eb606f53667171247a2b8baf07c051b703c Mon Sep 17 00:00:00 2001 From: Diogo Martins Date: Sat, 14 Feb 2026 16:16:08 +0000 Subject: [PATCH 2/2] Replaced templates + rewrite + file_server with respond {http.request.body} 200, which uses Caddy's native placeholder substitution to echo the POST body directly. --- docs/content/servers/caddy.md | 12 +----------- src/Servers/CaddyServer/Caddyfile | 5 +---- src/Servers/CaddyServer/Dockerfile | 1 - src/Servers/CaddyServer/body.html | 1 - 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 src/Servers/CaddyServer/body.html diff --git a/docs/content/servers/caddy.md b/docs/content/servers/caddy.md index e5b52b1..cc2e985 100644 --- a/docs/content/servers/caddy.md +++ b/docs/content/servers/caddy.md @@ -11,7 +11,6 @@ breadcrumbs: false ```dockerfile FROM caddy:2 COPY src/Servers/CaddyServer/Caddyfile /etc/caddy/Caddyfile -COPY src/Servers/CaddyServer/body.html /srv/body.html COPY src/Servers/CaddyServer/echo.html /srv/echo.html ``` @@ -28,10 +27,7 @@ COPY src/Servers/CaddyServer/echo.html /srv/echo.html path / } handle @post_root { - root * /srv - templates - rewrite * /body.html - file_server + respond "{http.request.body}" 200 } handle /echo { @@ -47,12 +43,6 @@ COPY src/Servers/CaddyServer/echo.html /srv/echo.html } ``` -## Source — `body.html` - -```html -{{- placeholder "http.request.body" -}} -``` - ## Source — `echo.html` ```html diff --git a/src/Servers/CaddyServer/Caddyfile b/src/Servers/CaddyServer/Caddyfile index daf76e0..94eaab5 100644 --- a/src/Servers/CaddyServer/Caddyfile +++ b/src/Servers/CaddyServer/Caddyfile @@ -8,10 +8,7 @@ path / } handle @post_root { - root * /srv - templates - rewrite * /body.html - file_server + respond "{http.request.body}" 200 } handle /echo { diff --git a/src/Servers/CaddyServer/Dockerfile b/src/Servers/CaddyServer/Dockerfile index 6227bfa..729486b 100644 --- a/src/Servers/CaddyServer/Dockerfile +++ b/src/Servers/CaddyServer/Dockerfile @@ -1,4 +1,3 @@ FROM caddy:2 COPY src/Servers/CaddyServer/Caddyfile /etc/caddy/Caddyfile -COPY src/Servers/CaddyServer/body.html /srv/body.html COPY src/Servers/CaddyServer/echo.html /srv/echo.html diff --git a/src/Servers/CaddyServer/body.html b/src/Servers/CaddyServer/body.html deleted file mode 100644 index d722472..0000000 --- a/src/Servers/CaddyServer/body.html +++ /dev/null @@ -1 +0,0 @@ -{{- placeholder "http.request.body" -}} \ No newline at end of file