From 815bc322b0746883700dc959e83bff180d351b7c Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 22 Oct 2013 10:34:29 +0300 Subject: [PATCH] Include a trailing newline in API responses This fixes an annoyance where using, e.g., git diff | curl -F 'content=<-' https://dpaste.de/api/ would place the bash prompt on the same line as the response. --- dpaste/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpaste/views.py b/dpaste/views.py index 2b96cd3..d07e76d 100644 --- a/dpaste/views.py +++ b/dpaste/views.py @@ -256,8 +256,8 @@ def snippet_api(request, enclose_quotes=True): response = 'https://dpaste.de%s' % s.get_absolute_url() if enclose_quotes: - return HttpResponse('"%s"' % response) - return HttpResponse(response) + return HttpResponse('"%s"\n' % response) + return HttpResponse(response + '\n') # -----------------------------------------------------------------------------