Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
feat(controller): add X_DEIS_PLATFORM_VERSION header in response
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Nov 25, 2014
1 parent ce12712 commit e1db573
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controller/api/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from api import __version__


class VersionMiddleware:
class APIVersionMiddleware:

def process_request(self, request):
try:
Expand Down
8 changes: 8 additions & 0 deletions controller/deis/middleware.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from deis import __version__


class PlatformVersionMiddleware:

def process_response(self, request, response):
response['X_DEIS_PLATFORM_VERSION'] = __version__
return response
3 changes: 2 additions & 1 deletion controller/deis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'api.middleware.VersionMiddleware',
'api.middleware.APIVersionMiddleware',
'deis.middleware.PlatformVersionMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
Expand Down

0 comments on commit e1db573

Please sign in to comment.