magic-proxy: Send headers on error (LP: #1829944)

This commit is contained in:
Robert C Jennings 2019-05-06 20:31:27 -05:00
parent b8e4966097
commit c10ca357b5
No known key found for this signature in database
GPG Key ID: 740C3D9EEDF2ED73
2 changed files with 7 additions and 0 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
livecd-rootfs (2.586) UNRELEASED; urgency=medium
* magic-proxy: Send headers on error (LP: #1829944)
-- Robert C Jennings <robert.jennings@canonical.com> Tue, 21 May 2019 19:18:47 -0500
livecd-rootfs (2.585) eoan; urgency=medium
[ Robert C Jennings ]

View File

@ -843,6 +843,7 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
"""Return an HTTP error status and a message in the response body."""
self.send_response(status)
self.send_header("Content-Type", "text/plain; charset=utf-8")
self.end_headers()
self.wfile.write(message.encode("utf-8"))