From 2a38a040924b621bce4e999b3c7dab692f497a21 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Tue, 28 Aug 2012 10:51:49 +0800 Subject: [PATCH] Remove the gettext wrapper of server_type. The gettext wrapper of server_type in controllers is used to translate server_type in log. But the transfer_headers function which used to filter the illegal metadata headers use the wrapped server_type. So, it will cause problems that 'X-Account-Meta-' and 'X-Container-Meta-' would be filtered when the language of operating system is not english, such as Chinese or Japnese. So, I removed the wrapper. Change-Id: I7d47e67b4caf5d0be171a90740f9bb12fa2cba84 Fixes: Bug #1042142 --- swift/proxy/controllers/account.py | 2 +- swift/proxy/controllers/base.py | 2 +- swift/proxy/controllers/container.py | 2 +- swift/proxy/controllers/obj.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swift/proxy/controllers/account.py b/swift/proxy/controllers/account.py index bd95d5555b..797fa56ac1 100644 --- a/swift/proxy/controllers/account.py +++ b/swift/proxy/controllers/account.py @@ -39,7 +39,7 @@ from swift.proxy.controllers.base import Controller class AccountController(Controller): """WSGI controller for account requests""" - server_type = _('Account') + server_type = 'Account' def __init__(self, app, account_name, **kwargs): Controller.__init__(self, app) diff --git a/swift/proxy/controllers/base.py b/swift/proxy/controllers/base.py index ac032676f8..7c07545012 100644 --- a/swift/proxy/controllers/base.py +++ b/swift/proxy/controllers/base.py @@ -87,7 +87,7 @@ def get_container_memcache_key(account, container): class Controller(object): """Base WSGI controller class for the proxy""" - server_type = _('Base') + server_type = 'Base' # Ensure these are all lowercase pass_through_headers = [] diff --git a/swift/proxy/controllers/container.py b/swift/proxy/controllers/container.py index 34c7339104..8827074117 100644 --- a/swift/proxy/controllers/container.py +++ b/swift/proxy/controllers/container.py @@ -40,7 +40,7 @@ from swift.proxy.controllers.base import Controller, delay_denial, \ class ContainerController(Controller): """WSGI controller for container requests""" - server_type = _('Container') + server_type = 'Container' # Ensure these are all lowercase pass_through_headers = ['x-container-read', 'x-container-write', diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 61b035e8bd..2fb2b2493c 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -232,7 +232,7 @@ class SegmentedIterable(object): class ObjectController(Controller): """WSGI controller for object requests.""" - server_type = _('Object') + server_type = 'Object' def __init__(self, app, account_name, container_name, object_name, **kwargs):