whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: make it easier to get JSON output
Date Sun, 03 Dec 2017 14:22:41 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new db94052  make it easier to get JSON output
db94052 is described below

commit db94052051a9b352e1da032ce891a8287dba3adf
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Dec 3 09:22:19 2017 -0500

    make it easier to get JSON output
---
 www/brand/list.cgi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/www/brand/list.cgi b/www/brand/list.cgi
index 8f9b504..610a1e3 100755
--- a/www/brand/list.cgi
+++ b/www/brand/list.cgi
@@ -1,6 +1,9 @@
 #!/usr/bin/env ruby
 PAGETITLE = "Listing of Apache Trademarks" # Wvisible:brand,trademarks
 
+# return output in JSON format if the query string includes 'json'
+ENV['HTTP_ACCEPT'] = 'application/json' if ENV['QUERY_STRING'].include? 'json'
+
 $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 require 'csv'
 require 'json'

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message