• David's avatar
    Don't allocate until we know it's worth it (#420) · 326d0c91
    David authored
    * 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
    326d0c91