Skip to content

Issues with large header values longer than 512 bytes #88

Description

@florianhoyer

I experienced that zsync breaks when the web server sends a quite long header. In my case it is S3 that sends an header access-control-allow-headers that is too big:

access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, X-Amz-Date, X-Amz-User-Agent, Authorization, x-amz-acl, X-Amz-Content-Sha256, ETag, Accept, Authorization, Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Length, Content-MD5, Content-Range, Content-Type, ETag, Expires, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, Last-Modified, Location, Origin, Range, X-Amz-Content-Sha256, X-Amz-Date, X-Amz-User-Agent, X-Requested-With, accept-ranges, amz-sdk-invocation-id, amz-sdk-request, x-amz-abort-date, x-amz-abort-rule-id, x-amz-acl, x-amz-content-sha256, x-amz-copy-source, x-amz-copy-source-if-match, x-amz-copy-source-if-modified-since, x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, x-amz-copy-source-range, x-amz-copy-source-version-id, x-amz-expiration, x-amz-metadata-directive, x-amz-mp-parts-count, x-amz-restore, x-amz-restore-output-path, x-amz-version-id, x-amz-website-redirect-location, sentry-trace

My local quickfix is to extend the header parsing buffer to 8192 bytes and it should be fine for most use-cases. I can open a Pull Request if you accept some.

Unfortunately my C++ skills are not good enough for an implementation that is independent from buffer length 😅

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions