comparison roundup/rest.py @ 5636:528b902f98fc

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
author John Rouillard <rouilj@ieee.org>
date Thu, 07 Mar 2019 18:08:32 -0500
parents a29a8dae2095
children 7e3cceec3f4f
comparison
equal deleted inserted replaced
5634:cb4b232fcbaa 5636:528b902f98fc
1304 # .../issue.json -> .../issue 1304 # .../issue.json -> .../issue
1305 uri = uri[:-( len(ext_type) + 1 )] 1305 uri = uri[:-( len(ext_type) + 1 )]
1306 1306
1307 # check for pretty print 1307 # check for pretty print
1308 try: 1308 try:
1309 pretty_output = input['pretty'].value.lower() == "true" 1309 pretty_output = not input['pretty'].value.lower() == "false"
1310 except KeyError: 1310 except KeyError:
1311 pretty_output = False 1311 pretty_output = True
1312 1312
1313 # add access-control-allow-* to support CORS 1313 # add access-control-allow-* to support CORS
1314 self.client.setHeader("Access-Control-Allow-Origin", "*") 1314 self.client.setHeader("Access-Control-Allow-Origin", "*")
1315 self.client.setHeader( 1315 self.client.setHeader(
1316 "Access-Control-Allow-Headers", 1316 "Access-Control-Allow-Headers",

Roundup Issue Tracker: http://roundup-tracker.org/