Skip to content

Commit a58f8c0

Browse files
committed
Make pretty print mode the default. Turn off using pretty=false. This
makes use by humans (e.g. in browser) or printing when debugging easier. With gzip and other compression the extra whitespace is not a major issue. Idea from: https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#pretty-print-gzip
1 parent 2221bf9 commit a58f8c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,9 @@ def dispatch(self, method, uri, input):
13061306

13071307
# check for pretty print
13081308
try:
1309-
pretty_output = input['pretty'].value.lower() == "true"
1309+
pretty_output = not input['pretty'].value.lower() == "false"
13101310
except KeyError:
1311-
pretty_output = False
1311+
pretty_output = True
13121312

13131313
# add access-control-allow-* to support CORS
13141314
self.client.setHeader("Access-Control-Allow-Origin", "*")

0 commit comments

Comments
 (0)