-
Notifications
You must be signed in to change notification settings - Fork 498
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
handler: Allow media type parameters in Content-Type headers #1253
Conversation
469b083
to
432a76b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to hear that we are now on the same page!
Can you please have a look at the failing tests? |
|
@Acconut Seems like a flaky e2e test. The Adding a bit of delay between PATCH and HEAD seems to let pass the test more reliable, but maybe it also hides some underlying problem. A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
Thank you for looking into the failing e2e although it's not caused by your PR here. I have also noticed that it randomly fails on Windows, while working fine on Linux. It seems to be caused by minor differences in Go's or the OS' networking stack on these platforms. Adding a short delay between the PATCH and HEAD request is fine. The test is about ensuring that tusd saves data even when the TCP connection is reset. This goal will not be compromised by a short delay. That being said, it seems like tusd on Windows is returning internal server errors where it actually should return ErrFileLocked:
and
Feel free to open another PR for the delay, if you are interested |
This pull request includes several changes to the
pkg/handler
package, focusing on improving the handling of MIME types and adding new tests. The most important changes include fixing a regular expression, updating comments, modifying the MIME type whitelist, and adding new unit tests.Improvements to MIME type handling:
pkg/handler/unrouted_handler.go
: Fixed a regular expression inreMimeType
to correctly match MIME types with a plus sign.pkg/handler/unrouted_handler.go
: Updated comments to correct typos and improve clarity.pkg/handler/unrouted_handler.go
: Addedvideo/mp4
to themimeInlineBrowserWhitelist
and reordered entries for better readability.Testing enhancements:
pkg/handler/unrouted_handler_test.go
: Changed the package name fromhandler_test
tohandler
to allow testing of unexported functions.pkg/handler/unrouted_handler_test.go
: Added a new test functionTestFilterContentType
to ensure thefilterContentType
function behaves correctly with various metadata inputs.