Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

(feat) Add support for request attributes - #100

Merged
mathieucarbou merged 1 commit into
mainfrom
attributes
Sep 11, 2024
Merged

(feat) Add support for request attributes#100
mathieucarbou merged 1 commit into
mainfrom
attributes

Conversation

@mathieucarbou

Copy link
Copy Markdown
Owner
  • request->setAttribute(name, val)
  • request->hasAttribute(name)
  • request->getAttribute(name, defaultValue)

@mathieucarbou

mathieucarbou commented Sep 8, 2024

Copy link
Copy Markdown
Owner Author

Since request attribute usage is relatively a niche use case, more useful with middleware, I decided to implement it using String as a data holder class. This is not the most efficient way, but since most of the use cases are String values in request attributes I think this is acceptable.

@DRSDavidSoft

Copy link
Copy Markdown

This is excellent implementation 👍🏻

@mathieucarbou
mathieucarbou force-pushed the attributes branch 3 times, most recently from 5ac5fd2 to e7210d5 Compare September 10, 2024 22:20
- request->setAttribute(name, val)
- request->hasAttribute(name)
- request->getAttribute(name, defaultValue)
@mathieucarbou
mathieucarbou merged commit 958f764 into main Sep 11, 2024
@mathieucarbou
mathieucarbou deleted the attributes branch September 13, 2024 23:04
i-am-shodan pushed a commit to i-am-shodan/ESPAsyncWebServer that referenced this pull request Apr 9, 2026
When accepting an upload, discard any bytes after Content-Length.  This
ensures that handlers such as AsyncJson can safely allocate the correct
sized buffer without needing to additionally check for overrun.

Fixes mathieucarbou#100
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants