Skip to content
This repository has been archived by the owner on Mar 1, 2018. It is now read-only.

Commit

Permalink
Tiny optimization
Browse files Browse the repository at this point in the history
Signed-off-by: Laura <l@veriny.tf>
  • Loading branch information
Fuyukai committed Jul 8, 2017
1 parent 0023adf commit b4f0a7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kyoukai/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from kyoukai.blueprint import Blueprint

__version__ = "2.2.1"
version_format = "Kyoukai/{}".format(__version__)

logger = logging.getLogger("Kyoukai")

Expand Down Expand Up @@ -315,13 +316,13 @@ async def process_request(self, request: Request, parent_context: Context) -> Re
self.log_route(ctx.request, result.status_code)

# Update the Server header.
result.headers["Server"] = "Kyoukai/{}".format(__version__)
result.headers["Server"] = version_format

# list means wsgi response probably
if not isinstance(result.response, (bytes, str, list)):
result.set_data(str(result.response))

result.headers["X-Powered-By"] = "Kyoukai/{}".format(__version__)
result.headers["X-Powered-By"] = version_format

# Return the new Response.
return result
Expand Down

0 comments on commit b4f0a7d

Please sign in to comment.