From 42b68078402f9715b9b480356d35dc1bd3ecfbdf Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 23 Feb 2017 08:55:48 -0500 Subject: [PATCH] Add referer header to https requests Another firmware change becomes sensitive to the value of referer. This adds the same referer header value that would occur naturally from a browser. Change-Id: I20928bbd88a4df281f9fb4f7cc472419a6059f09 --- pyghmi/ipmi/oem/lenovo/imm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 574f26ea..4309a7ff 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -96,6 +96,8 @@ class IMMClient(object): 'SessionTimeout': 60 }) headers = {'Connection': 'keep-alive', + 'Referer': 'https://{0}/designs/imm/index.php'.format( + self.imm), 'Content-Type': 'application/x-www-form-urlencoded'} wc.request('POST', '/data/login', adata, headers) rsp = wc.getresponse()