Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
cowboy_static + onresponse hook #738
When the response reaches the 'onresponse' hook serving a static file, the Body parameter is empty (guess it will be later served from disk with some low-cost approach). This way it is not possible, to modify the headers in the response hook, because replying is not possible without the contents of the body, and simply returning the original Request has no effect on the Headers.
For a workaround, I am currently reading the files myself, and sending a response, which I can handle by the hook. Would be nice, if this hook could be used when serving static files (and streams?) too, maybe somehow being able to modify the already computed Headers, when the Body is still not available?
Keep up the great work, cheers!