From 9abf323e7d7036529b1a526086d6239ec7e5d3d5 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 26 Jan 2015 14:40:31 +0100 Subject: [PATCH] Send GNS 3 server version in header and upgrade aiohttp --- gns3server/web/response.py | 4 ++++ requirements.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gns3server/web/response.py b/gns3server/web/response.py index 04d0846a..b958c7f6 100644 --- a/gns3server/web/response.py +++ b/gns3server/web/response.py @@ -19,6 +19,8 @@ import json import jsonschema import aiohttp.web import logging +import sys +from ..version import __version__ log = logging.getLogger(__name__) @@ -30,6 +32,7 @@ class Response(aiohttp.web.Response): self._route = route self._output_schema = output_schema headers['X-Route'] = self._route + headers['Server'] = "Python/{0[0]}.{0[1]} GNS3/{1}".format(sys.version_info, __version__) super().__init__(headers=headers, **kwargs) """ @@ -42,6 +45,7 @@ class Response(aiohttp.web.Response): def json(self, answer): """Pass a Python object and return a JSON as answer""" + print(self.headers) self.content_type = "application/json" if hasattr(answer, '__json__'): answer = answer.__json__() diff --git a/requirements.txt b/requirements.txt index a7f54074..b7c04a29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ pycurl==7.19.5 python-dateutil==2.3 apache-libcloud==0.16.0 requests==2.5.0 -aiohttp==0.13.1 +aiohttp==0.14.2