Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TusClient is missing required headers #91

Closed
richard-keller opened this issue Oct 21, 2018 · 2 comments
Closed

TusClient is missing required headers #91

richard-keller opened this issue Oct 21, 2018 · 2 comments
Assignees
Labels
Projects
Milestone

Comments

@richard-keller
Copy link

I'm currently trying to use tus-php to upload to CloudFlare Stream. It looks like tus-php doesn't include all the standard required headers that the Tus protocol requires, and CloudFlare ends up giving an obscure error, and doesn't upload the file successfully.

Is there any way to output debug information so that I can see the contents of the HTTP request (including all headers) so that I can debug further?

I've considered intercepting the traffic using Wireshark, but CloudFlare uses HTTPS, which makes this rather difficult.

@ankitpokhrel
Copy link
Owner

@richard-keller you can pass ['debug' => true] to guzzle options to debug requests after #90 is merged.

It looks like tus-php doesn't include all the standard required headers that the Tus protocol requires

Can you be more specific on what headers are missing?

@richard-keller
Copy link
Author

When sending a HEAD request, the header must contain a Tus-Resumable field which specifies the Tus version. As far as I can see, tus-php isn't sending the Tus version header. The request should look like this:

HEAD /files/24e533e02ec3bc40c387f1a0e460e216 HTTP/1.1
Host: tus.example.org
Tus-Resumable: 1.0.0

Additionally, when sending a PATCH request, the header must contain the Upload-Offset and Tus-Resumable fields. As far as I can see, tus-php isn't sending these.

From the protocol documentation:

The Tus-Resumable header MUST be included in every request and response except for OPTIONS requests. The value MUST be the version of the protocol used by the Client or the Server.

The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer.

https://tus.io/protocols/resumable-upload.html#core-protocol

@ankitpokhrel ankitpokhrel self-assigned this Oct 21, 2018
@ankitpokhrel ankitpokhrel changed the title Ability to display debug output TusClient is missing required headers Oct 21, 2018
@ankitpokhrel ankitpokhrel added this to the Unreleased milestone Oct 21, 2018
@ankitpokhrel ankitpokhrel added this to To Do in Kanban Oct 21, 2018
@ankitpokhrel ankitpokhrel moved this from To Do to In progress in Kanban Oct 22, 2018
@ankitpokhrel ankitpokhrel added the client Tus Client label Oct 23, 2018
Kanban automation moved this from In progress to Done Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Kanban
  
Done
Development

No branches or pull requests

2 participants