Skip to content

Use case-insenitive match for HTTP header (Content-Length extraction)#196

Open
optout21 wants to merge 1 commit intoBlockstream:new-indexfrom
optout21:header-case
Open

Use case-insenitive match for HTTP header (Content-Length extraction)#196
optout21 wants to merge 1 commit intoBlockstream:new-indexfrom
optout21:header-case

Conversation

@optout21
Copy link

Fixes #193
Electr relies on the value from the "Content-Length" HTTP header to check the length of the received RPC response. Parsing of the HTTP header is done directly, and it's done case-sensitive. This is fine with bitcoin code nodes, that use the "Content-Length" title case format, but it's not standards compliant, and fails with other providers, e.g. a third-party proxy between the bitcoin node and electrs.
The fix is rather straigtforward: store headers lowercase, and compare against the lower case version.,

@EddieHouston
Copy link
Collaborator

lgtm

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.

Failure due to context-sensitive checking of HTTP header Content-Length

3 participants