1. Jason R. Coombs
  2. stackoverflow

Source

stackoverflow / 2454494 / server.py

import cherrypy

def multi_headers():
	cherrypy.response.header_list.extend(cherrypy.response.multiheaders)

cherrypy.tools.multiheaders = cherrypy.Tool('on_end_resource', multi_headers)

class Root(object):
	@cherrypy.expose
	@cherrypy.tools.multiheaders()
	def index(self):
		cherrypy.response.multiheaders = [('foo', '1'), ('foo', '2')]
		return "Hello"

cherrypy.quickstart(Root())