{"action":"created","issue":{"url":"https://api.github.com/repos/labstack/echo/issues/471","repository_url":"https://api.github.com/repos/labstack/echo","labels_url":"https://api.github.com/repos/labstack/echo/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/labstack/echo/issues/471/comments","events_url":"https://api.github.com/repos/labstack/echo/issues/471/events","html_url":"https://github.com/labstack/echo/issues/471","id":148904357,"number":471,"title":"Resumeable Static Content","user":{"login":"aarondl","id":699706,"avatar_url":"https://avatars.githubusercontent.com/u/699706?v=3","gravatar_id":"","url":"https://api.github.com/users/aarondl","html_url":"https://github.com/aarondl","followers_url":"https://api.github.com/users/aarondl/followers","following_url":"https://api.github.com/users/aarondl/following{/other_user}","gists_url":"https://api.github.com/users/aarondl/gists{/gist_id}","starred_url":"https://api.github.com/users/aarondl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aarondl/subscriptions","organizations_url":"https://api.github.com/users/aarondl/orgs","repos_url":"https://api.github.com/users/aarondl/repos","events_url":"https://api.github.com/users/aarondl/events{/privacy}","received_events_url":"https://api.github.com/users/aarondl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-04-17T00:14:21Z","updated_at":"2016-08-26T18:46:39Z","closed_at":null,"body":"From the documentation at: https://golang.org/pkg/net/http/#ServeContent:\r\n\r\n```text\r\nServeContent replies to the request using the content in the provided ReadSeeker.\r\nThe main benefit of ServeContent over io.Copy is that it handles Range requests\r\nproperly, sets the MIME type, and handles If-Modified-Since requests.\r\n```\r\n\r\nEcho does not support this functionality.\r\nWe can see `echo.Context.File()` calls `context.ServeContent`:\r\nhttps://github.com/labstack/echo/blob/master/context.go#L381\r\nWhich does a basic `io.Copy()` to send the entire file to the user:\r\nhttps://github.com/labstack/echo/blob/master/context.go#L439\r\n\r\nSo in the current implementation when you call `echo.Context.File` there's no chance that anything will be resumed if a download had cut off previously and a browser attempts to resume it using the HTTP Range header which isn't considered by this code. It simply sends the entire file every time.\r\n\r\nThe documentation surrounding HTTP Range is here: https://tools.ietf.org/html/rfc7233\r\n\r\nOne more advantage the standard library has over this is that the Content-Size header is also set which is not the case in the echo code.\r\n\r\nIdeally we'd be able to completely defer to the standard libraries `http.ServeContent` method."},"comment":{"url":"https://api.github.com/repos/labstack/echo/issues/comments/242819140","html_url":"https://github.com/labstack/echo/issues/471#issuecomment-242819140","issue_url":"https://api.github.com/repos/labstack/echo/issues/471","id":242819140,"user":{"login":"hexadecy","id":10960108,"avatar_url":"https://avatars.githubusercontent.com/u/10960108?v=3","gravatar_id":"","url":"https://api.github.com/users/hexadecy","html_url":"https://github.com/hexadecy","followers_url":"https://api.github.com/users/hexadecy/followers","following_url":"https://api.github.com/users/hexadecy/following{/other_user}","gists_url":"https://api.github.com/users/hexadecy/gists{/gist_id}","starred_url":"https://api.github.com/users/hexadecy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexadecy/subscriptions","organizations_url":"https://api.github.com/users/hexadecy/orgs","repos_url":"https://api.github.com/users/hexadecy/repos","events_url":"https://api.github.com/users/hexadecy/events{/privacy}","received_events_url":"https://api.github.com/users/hexadecy/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T18:46:39Z","updated_at":"2016-08-26T18:46:39Z","body":"I'm trying to stream an ogg audio file. \r\nPreviously, I was using `http.ServeFile` and it worked really well.\r\nPlease add support or if someone have a quick workaround.\r\n"}}
{"actor":{"display_login":"hexadecy"}}