8000 hg: set responses from hgmin service to text/plain (#590) · python/psf-salt@3efc8ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 3efc8ff

Browse files
authored
hg: set responses from hgmin service to text/plain (#590)
1 parent a9fd3c8 commit 3efc8ff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

salt/hg/files/hg/src/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def lookup(rev):
3131
rev = rev[len("git") :]
3232
url = "https://github.com/python/cpython/commit/" + rev
3333
if url is None:
34-
return make_response(
34+
response = make_response(
3535
(
3636
"Usage: /lookup/GITHEXHASH or gitGITHEXHASH "
3737
"(10, 11, or 40 hex characters)\n",
@@ -40,6 +40,8 @@ def lookup(rev):
4040
),
4141
404,
4242
)
43+
response.headers["Content-Type"] = "text/plain"
44+
return response
4345
else:
4446
return redirect(url, code=303)
4547

@@ -60,13 +62,15 @@ def hgrev(repo, rev):
6062
check=True,
6163
)
6264
except Exception as e:
63-
return make_response(
65+
response = make_response(
6466
(
6567
f"{str(e)}\n"
6668
"Usage: path/to/hg/repo/rev/HGHEXNODE "
6769
"(12 or 40 hex characters)\n"
6870
),
6971
404,
7072
)
73+
response.headers["Content-Type"] = "text/plain"
74+
return response
7175

7276
return make_response(result.stdout, 200)

0 commit comments

Comments
 (0)
0