summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kosenkov <NKosenkov@IBS.RU>2022-07-27 11:09:58 +0300
committerNikita Kosenkov <NKosenkov@IBS.RU>2022-07-27 11:09:58 +0300
commit6d1b0d0690f463daf27a367742e53df27e801bbb (patch)
tree3ac00501d3423e7106f640ab41f1d71dc0faa67c
parent3b5761c9617409836ea589eaf7e8e0c8d94424c2 (diff)
downloadopenbmc-6d1b0d0690f463daf27a367742e53df27e801bbb.tar.xz
bmcweb: add revert patch for commit 347d1a195e1f0a9765bc8ae7be39f6eb6577d487
-rw-r--r--meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Revert-Rearrange-forward_unauthorized.patch70
-rw-r--r--meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend1
2 files changed, 71 insertions, 0 deletions
diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Revert-Rearrange-forward_unauthorized.patch b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Revert-Rearrange-forward_unauthorized.patch
new file mode 100644
index 0000000000..185f158230
--- /dev/null
+++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0003-Revert-Rearrange-forward_unauthorized.patch
@@ -0,0 +1,70 @@
+From 008560b02f941ba73b5ff84db42f7e28e668aea2 Mon Sep 17 00:00:00 2001
+From: Nikita Kosenkov <NKosenkov@IBS.RU>
+Date: Wed, 27 Jul 2022 10:44:41 +0300
+Subject: [PATCH] Revert "Rearrange forward_unauthorized"
+
+This reverts commit 347d1a195e1f0a9765bc8ae7be39f6eb6577d487.
+---
+ include/forward_unauthorized.hpp | 43 ++++++++++++++++----------------
+ 1 file changed, 22 insertions(+), 21 deletions(-)
+
+diff --git a/include/forward_unauthorized.hpp b/include/forward_unauthorized.hpp
+index ddf3e3b1..5b437b16 100644
+--- a/include/forward_unauthorized.hpp
++++ b/include/forward_unauthorized.hpp
+@@ -22,30 +22,31 @@ inline void sendUnauthorized(std::string_view url,
+ res.result(boost::beast::http::status::temporary_redirect);
+ res.addHeader("Location",
+ "/#/login?next=" + http_helpers::urlEncode(url));
+- return;
+ }
+- // If we don't have a webui installed, just return an unauthorized
+- // body
+- res.result(boost::beast::http::status::unauthorized);
+- res.body() = "Unauthorized";
+- return;
+- }
+-
+- res.result(boost::beast::http::status::unauthorized);
+-
+- // XHR requests from a browser will set the X-Requested-With header when
+- // doing their requests, even though they might not be requesting html.
+- if (!xRequestedWith.empty())
+- {
+- return;
++ else
++ {
++ // If we don't have a webui installed, just return a lame
++ // unauthorized body
++ res.result(boost::beast::http::status::unauthorized);
++ res.body() = "Unauthorized";
++ }
+ }
+- // if basic auth is disabled, don't propose it.
+- if (!persistent_data::SessionStore::getInstance()
+- .getAuthMethodsConfig()
+- .basic)
++ else
+ {
+- return;
++ res.result(boost::beast::http::status::unauthorized);
++
++ // XHR requests from a browser will set the X-Requested-With header when
++ // doing their requests, even though they might not be requesting html.
++ if (!xRequestedWith.empty())
++ {
++ // Only propose basic auth as an option if it's enabled.
++ if (persistent_data::SessionStore::getInstance()
++ .getAuthMethodsConfig()
++ .basic)
++ {
++ res.addHeader("WWW-Authenticate", "Basic");
++ }
++ }
+ }
+- res.addHeader("WWW-Authenticate", "Basic");
+ }
+ } // namespace forward_unauthorized
+--
+2.35.1
+
diff --git a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
index ba02efb89d..9d7757b900 100644
--- a/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -5,6 +5,7 @@ SRCREV = "a170f2756716f13d906678ab93351ead035e37b4"
SRC_URI += "\
file://0001-Enable-vm-nbdproxy-option.patch \
file://0002-Add-http-ftp-nfs-protocols-to-un-filter-them-FT-58-T.patch \
+ file://0003-Revert-Rearrange-forward_unauthorized.patch \
"
EXTRA_OEMESON += "\