set content-type to mimetype

This commit is contained in:
James Turk 2011-07-29 10:16:45 -04:00
parent 0a2b3bfae7
commit 81ef0e71f0

View File

@ -1,5 +1,5 @@
from flask import Flask from flask import Flask, make_response
from .client import Client from oyster.client import Client
app = Flask('oyster') app = Flask('oyster')
@ -12,7 +12,10 @@ def show_doc(url, version):
c = Client() c = Client()
if version == 'latest': if version == 'latest':
version = -1 version = -1
return c.get_version(url, version).read() doc = c.get_version(url, version)
resp = make_response(doc.read())
resp.headers['content-type'] = doc.mimetype
return resp
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run(debug=True)