fix(controller/paste): prioritize encoding over highlighting

This commit is contained in:
Tiara Rodney 2022-04-15 03:53:18 +02:00
parent 5288c64cbb
commit e4de8e285e

View file

@ -100,11 +100,13 @@ def get(**kwargs):
else: else:
paste_model.remove(pid, backend.paste) paste_model.remove(pid, backend.paste)
if encoding is not None:
data = data.decode(encoding)
if syntax is not None: if syntax is not None:
data = highlight(data, str(syntax), formatter, linenos) data = highlight(data, str(syntax), formatter, linenos)
if encoding is not None:
data = data.decode(encoding)
return ConnexionResponse( return ConnexionResponse(
status_code=200, status_code=200,