Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
HTTP HTTP
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • RiscOS
    • SSources
    • NNetworking
  • Fetchers
  • HTTPHTTP
  • Merge requests
  • !7

Merged
Created Nov 29, 2021 by Matthew Phillips@mphillipsDeveloper

Allow for leading zero in chunk lengths for chunked transfer encoding

  • Overview 2
  • Commits 1
  • Changes 1

Some web servers use "Transfer-Encoding: chunked" when transferring the body of an HTTP response.

According to the HTTP/1.1 Specification section 3.6.1 the chunk length is encoded as one or more hex digits followed by an optional chunk extension introduced by semicolon or CR+LF. There is no requirement for the first digit of the chunk extension to be non-zero.

Currently the AcornHTTP header interpretation assumes that if there is a leading zero then the number of bytes is zero. This causes some fetches to fail. The example I encountered was the WikiData API endpoint at https://query.wikidata.org/sparql

The fix appears to be a simple matter of removing the check for the leading zero, as the actual value of the hex number has already been calculated a few lines further up.

I don't know what incantations are needed to increase the module number. The merge request only includes the actual code change.

Edited Nov 29, 2021 by Matthew Phillips
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: ChunkLengthFix