Skip to content

Conversation

@kentbull
Copy link

@kentbull kentbull commented Aug 20, 2025

The prior version of the RequestLoggerMiddleware would consume the request body stream with req.stream.read() which broke HTTP POST requests (currently unused by the did:webs resolver) because the stream is a one-shot IO read meaning that the stream must be reset in order to be later consumed by the Falcon HTTP request handler. The logging was also updated to use placeholders rather than f-strings for performance.

@kentbull kentbull force-pushed the fix-request-logging-middleware branch from 3d72d12 to 6f2e543 Compare August 20, 2025 22:45
@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.65%. Comparing base (b8c0dda) to head (5b862a7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   98.64%   98.65%   +0.01%     
==========================================
  Files          15       15              
  Lines        1036     1044       +8     
  Branches      127      128       +1     
==========================================
+ Hits         1022     1030       +8     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The prior version of the RequestLoggerMiddleware would consume the request body stream with req.stream.read() which broke things because the stream is a one-shot IO read meaning that the stream must be reset in order to be later consumed by the Falcon HTTP request handler. The logging was also updated to use placeholders rather than f-strings for performance.
@kentbull kentbull force-pushed the fix-request-logging-middleware branch from 6f2e543 to 543fd75 Compare August 21, 2025 15:51
The prior use of the /local directory with a raw "with open" call caused the tests to be brittle. The use of pathlib to dynamically load a relative path enables the tests to be runnable from any directory.
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