Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Case-insensitive header parsing needed #184

Open
Labels
topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project
@tjoyal

Description

@tjoyal

Being new to the Arduino ecosystem and not yet confident in my C++ skills, I'm unable to propose a pull request at this time. However, I wanted to share my investigation in case it proves helpful to others facing a similar problem.

The behavior I observed withclient.responseBody() seemed to vary depending on the server I was communicating with. For a server sending{ "test": 1234 }, the function returned:

10{ "test": 1234 }0

(indicating the hexadecimal size of the payload, the payload itself, and a null terminator).

Furthermore, theclient.isResponseChunked() method, intended to indicate a transfer-encoding chunked response, sometimes returned0 and other times1.

Through investigation, I discovered that the relevant header in the response wastransfer-encoding: chunked. The current code appears to be looking for the case-sensitiveTransfer-Encoding: chunked.

#defineHTTP_HEADER_TRANSFER_ENCODING"Transfer-Encoding"

For reference, RFC 2616 section 4.2, HTTP header field names are defined to be case-insensitive.
https://datatracker.ietf.org/doc/html/rfc2616#section-4.2

In my local testing, modifying#define HTTP_HEADER_TRANSFER_ENCODING "transfer-encoding" resolved the issue when interacting with my particular server. Enhancing the header parsing logic for case-insensitive comparisons of header field names would, I believe, eliminate a category of difficult-to-explain errors. I am uncertain whetherHTTP_HEADER_CONTENT_LENGTH is subject to a similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp