From db1a21e373bcabe48ced67a5334a1019852b971d Mon Sep 17 00:00:00 2001 From: Deepak Kodihalli Date: Thu, 27 Apr 2017 06:30:11 -0500 Subject: rest_dbus: fix content-type check Check content-type only for PUT, POST and PATCH. Resolves openbmc/openbmc#1525. Change-Id: I8ddddb344ecec13e1c07a7dba2ccac56c80302f7 Signed-off-by: Deepak Kodihalli --- module/obmc/wsgi/apps/rest_dbus.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/obmc/wsgi/apps/rest_dbus.py b/module/obmc/wsgi/apps/rest_dbus.py index b4a6d0f..55d5b44 100644 --- a/module/obmc/wsgi/apps/rest_dbus.py +++ b/module/obmc/wsgi/apps/rest_dbus.py @@ -844,7 +844,8 @@ class ContentCheckerPlugin(object): self.error_str = "Expecting content type '%s', got '%s'" def __call__(self, *a, **kw): - if self.expected_type and \ + if request.method in ['PUT', 'POST', 'PATCH'] and \ + self.expected_type and \ self.expected_type != request.content_type: abort(415, self.error_str % (self.expected_type, request.content_type)) -- cgit v1.2.1