publish: Use 'x-raw-file' internal response header.
authorLudovic Courtès <ludo@gnu.org>
Thu, 4 Jan 2018 23:15:51 +0000 (00:15 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 7 Jan 2018 22:47:22 +0000 (23:47 +0100)
commit152b7beeacb72fe96fd5d3c0fd8b321e247c2c6c
tree0533c1fb24a8c72206ea27f873b8cebb73abd468
parent06e3a5181efa0ea83bb6608d3cbfba5caa56d7e9
publish: Use 'x-raw-file' internal response header.

This adjusts the workaround for <http://bugs.gnu.org/21093> so that it's
not limited to a single content-type.

* guix/scripts/publish.scm (render-nar/cached): Add the 'x-raw-file'
header on the response.
(render-content-addressed-file): Likewise.
(with-content-length): Remove the 'x-raw-file' header.
(http-write): Instead of dispatching on 'application/octet-stream',
check whether 'x-raw-file' is set to determine whether to spawn a
thread.
guix/scripts/publish.scm