Skip to content

Fix Traefik POST / to echo request body (#54)#79

Merged
MDA2AV merged 1 commit intoMDA2AV:mainfrom
SAILESH4406:fix-traefik-post-echo
Feb 15, 2026
Merged

Fix Traefik POST / to echo request body (#54)#79
MDA2AV merged 1 commit intoMDA2AV:mainfrom
SAILESH4406:fix-traefik-post-echo

Conversation

@SAILESH4406
Copy link
Contributor

Description

This PR fixes the Traefik server implementation to correctly echo the request body when handling POST / requests.

Previously, the server was only handling the /echo route and returning request headers, without reading or returning the request body. This did not meet the expected behavior described in issue #54.

Changes Made

  • Updated route handler to listen on / instead of /echo
  • Restricted handler to POST method
  • Implemented request body reading using io.ReadAll
  • Ensured response returns the same body content
  • Added proper HTTP status handling (405 for non-POST methods)

Expected Behavior

When sending: POST

With a request body, the server now:

  • Returns 200 OK
  • Echoes the exact request body content in the response

Checklist

  • POST / correctly echoes request body
  • Non-POST methods return 405 Method Not Allowed
  • No unrelated files modified
  • Implementation matches issue requirements

Closes #54

@MDA2AV MDA2AV merged commit 3d3085d into MDA2AV:main Feb 15, 2026
1 check failed
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.

Fix - Traefik - Not echoing body content on POST / requests

2 participants