fix: catch io.copy errors when serving content
What does this MR do?
While investigating https://gitlab.com/gitlab-org/gitlab-pages/-/issues/690 I have found a bunch of errors being ignored around the codebase. This is problematic, especially this case: the error is ignored and a 200 OK
status is returned.
This is vendored code so there's a redundant if to reduce the diff with upstream code.
TODO
-
I added the Changelog
trailer (e.g.Changelog: added
) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Edited by feistel