Comments (4)
Hello,
You are completely right. Currently, headers are stored in a std::unordered_map
for constant-time access, which makes case-insensitive access a little bit tricky (we would need to define our own case-insensitive std::hash
, or insert lower-case header names into the map).
I think I'll consider switching from std::unordered_map
to std::vector
or even SmallVector
. Lookup will be linear this time but I do not really expect requests to have that much headers. Case-insensitive lookup should then be trivial
from pistache.
I would probably just transform all header lookup requests into lower-case and only insert lower-case header names into whatever data structure you choose to utilize. The case insensitive hash sounds like a somewhat complicated approach and you won't enforce that there is only one version of the case-insensitive string in the data structure.
from pistache.
I think this should be a mandatory change, because, according to IETF RFC 7230, section 3.2 (Header Fields):
Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace
I have a similar problem with Postman (a simple HTTP client) sending "content-length" instead of "Content-Length".
from pistache.
Should be closed? 54a3731
from pistache.
Related Issues (20)
- [BUG] ResponseWriter::setCompression() chokes on identity encoding
- [BUG] Fails to fetch build dependencies in autopkgtest HOT 7
- [BUG] All PPA builds failing due to missing zlib headers
- [BUG] New compression code fails to build on armhf HOT 5
- decode uri
- Complete BSD support HOT 4
- "Stack smashing detected" error in ubuntu docker container HOT 17
- New release to conan HOT 1
- keep alive timeout doesn't add to response header
- Pistache very poor performance when POST size exceeds `Endpoint::options().maxRequestSize()`, and `maxRequestSize` is large. HOT 4
- Out of bound read in std::strtol while parsing HTTP requests HOT 4
- Endpoint::Options::backlog_ is not used HOT 2
- What's up with the logging? HOT 3
- [FEATURE REQUEST] Add support for zstd compression
- ci: coverage fails on debian:testing runners HOT 3
- Cant stream MJPEG with multipart/x-mixed-replace HOT 2
- releasing / tagging HOT 1
- Pistacheio support for QNX
- “stack smashing detected” error when processing Get requests via generated-cpp-pistache-server HOT 6
- failed to build example HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pistache.