forked from shaba/openuds
Added UDS-Version as header on response to REST api
This commit is contained in:
parent
16d6e515c6
commit
610085e353
@ -32,7 +32,6 @@
|
|||||||
import os.path
|
import os.path
|
||||||
import pkgutil
|
import pkgutil
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
import typing
|
import typing
|
||||||
@ -41,8 +40,8 @@ from django import http
|
|||||||
from django.views.generic.base import View
|
from django.views.generic.base import View
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.utils.translation import ugettext as _, activate
|
from django.utils.translation import ugettext as _
|
||||||
from django.conf import settings
|
from uds.core import VERSION, VERSION_STAMP
|
||||||
|
|
||||||
from .handlers import (
|
from .handlers import (
|
||||||
Handler,
|
Handler,
|
||||||
@ -151,6 +150,7 @@ class Dispatcher(View):
|
|||||||
if not handler.raw: # Raw handlers will return an HttpResponse Object
|
if not handler.raw: # Raw handlers will return an HttpResponse Object
|
||||||
response = processor.getResponse(response)
|
response = processor.getResponse(response)
|
||||||
# Set response headers
|
# Set response headers
|
||||||
|
response['UDS-Version'] = f'{VERSION};{VERSION_STAMP}'
|
||||||
for k, val in handler.headers().items():
|
for k, val in handler.headers().items():
|
||||||
response[k] = val
|
response[k] = val
|
||||||
return response
|
return response
|
||||||
|
Loading…
Reference in New Issue
Block a user