Unverified Commit 326d0c91 authored by David's avatar David Committed by GitHub
Browse files

Don't allocate until we know it's worth it (#420)

* Sniff the first byte to glean if the incoming request is a single or batch request

This works around the serde limitations around `untagged` enums and `RawValue`.

* fmt

* For http server, check first byte before allocating space for the body

Also, rework the way we return errors: prefer JSON-RPC errors according to spec (application/json) wherever sensible.

* Review feedback

* Don't assume there is a first byte to read

* ty clipyp

* Review concerns

* Cleanup
parent 32811d3c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment