ankitpokhrel / ankitpokhrel/tus-php

Checksum implementation does not match TUS specification

Aperta
#422 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
1.5k
Fork
220
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Describe the bug**
While Implementing my own PHP server-side code for receiving TUS uploads, and using your implementation as a reference, I noticed that your checksum implementation works completely different from what is specified in the TUS Checksum Extension specification.

**To "Reproduce"**
Your implementation expects a checksum for the whole upload in the Upload-Creation POST request and checks the whole upload against that checksum at the end.

**Expected behavior**
According to [the spec](https://tus.io/protocols/resumable-upload.html#checksum), the checksum should be read from the header of each PATCH request and should only be checked against the data contained in that request.

**Screenshots**
Not applicable.

**Additional context**
I have to say, that I much prefer your implementation, as it makes much more sense for regular (un-chunked) file uploads. However it is not conforming to the spec, which is aimed at more general-purpose uploading. The server advertises support for the checksum extension, but will then completely ignore any checksums received in PATCH-requests. And no spec-conforming client will send a Upload-Checksum header with the upload-creation POST.

In my implementation I will replicate your behaviour using upload metadata, so it won't conflict with the TUS specification.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.