Skip to content

add option for extra HTTP headers containing checksums#211

Open
yol wants to merge 1 commit intovideolabs:masterfrom
xbmc:checksum-headers
Open

add option for extra HTTP headers containing checksums#211
yol wants to merge 1 commit intovideolabs:masterfrom
xbmc:checksum-headers

Conversation

@yol
Copy link
Copy Markdown

@yol yol commented Mar 28, 2026

adds an rfc1864 compatible content-md5 header and analog extensions for sha1 and sha256 if the option CheckSumHeaders is true the following extra http headers will be added:
Content-Md5: I9rjdRkQr90tbzCzZtDy4A==
Content-Sha1: kvbBunf6Il0/5oMcuItvYcaHN9c=
Content-Sha256: ktVLJsGP3LWFWjCsQLAXtIWE1kd3b+bXyNWmoFbxvV0=

adds an rfc1864 compatible content-md5 header and analog extensions for sha1 and sha256
if the option CheckSumHeaders is true the following extra http headers will be added:
  Content-Md5: I9rjdRkQr90tbzCzZtDy4A==
  Content-Sha1: kvbBunf6Il0/5oMcuItvYcaHN9c=
  Content-Sha256: ktVLJsGP3LWFWjCsQLAXtIWE1kd3b+bXyNWmoFbxvV0=
@elboulangero
Copy link
Copy Markdown
Contributor

What is the use-case?

@yol
Copy link
Copy Markdown
Author

yol commented Mar 31, 2026

It's used by kodi to verify that the mirror that it gets redirected to is delivering the expected file unaltered

@elboulangero
Copy link
Copy Markdown
Contributor

For reference, these are the mirrorbits changes on kodi's side, from 2018: https://github.com/xbmc/mirrorbits/pulls?q=is%3Apr+is%3Aclosed

I did some research and RFC-1864 seems to be considered deprecated since HTTP/1.1 (grep for Content-Md5 in RFC-7231). Plus, Content-Sha1 and Content-Sha256 are not part of this RFC, so they would be custom additions.

OTOH, there's this old discussion: #49 (comment), where etix discussed RFC-6249 and adding support for a Digest field.

It seems to me that RFC-6249 would be a better way to go.

RFC names:

  • RFC-1864: The Content-MD5 Header Field
  • RFC-6249: Metalink/HTTP: Mirrors and Hashes
  • RFC-7231: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

@yol
Copy link
Copy Markdown
Author

yol commented Mar 31, 2026

We do not have the option to use any different structure/headers,, since Kodi expects the Content-* headers and we cannot retro-patch every active installation out there. So at least for us, this would not be an option. We can also keep it alive in our fork if that is preferred.

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.

3 participants