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

does fasthhttp support multipart/byteranges? #1312

Open
byene0923 opened this issue Jun 5, 2022 · 3 comments
Open

does fasthhttp support multipart/byteranges? #1312

byene0923 opened this issue Jun 5, 2022 · 3 comments

Comments

@byene0923
Copy link
Contributor

i see in fs.go that fasthttp may not handle multipart/byteranges .
will fasthttp support it ? if so, i'm willing to do it

@erikdubbelboer
Copy link
Collaborator

A pull is always welcome!

@byene0923
Copy link
Contributor Author

support multipart/byteranges is a bit complex

the content of multipart/byteranges like

--3d6b6a416f9b5
Content-Type: text/html
Content-Range: bytes 0-50/1270

<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Example Do
--3d6b6a416f9b5
Content-Type: text/html
Content-Range: bytes 100-150/1270

eta http-equiv="Content-type" content="text/html; c
--3d6b6a416f9b5--

this is quiet different from Single part ranges, we need to add Content-Type, Content-Range and Boundary of each range
however, fasthttp use []byte to handle content and we may not read all the content in one time. so we need carefully handle content and add extra information.
also, we need to calculate the length which include the extra information

so i seperate the fsReader and RangeFsReader. fsReader handle the complete file and RangeFsReader handle the range file
i will pr later

@byene0923
Copy link
Contributor Author

there exists bugs in my pull request, i reopen it

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

No branches or pull requests

2 participants