Fix event entry download
Event entry should be downloaded with specific http header of "Accept:
application/octet-stream" or "*/*", but the default http header is set
to "Accept: application/json", so need to specify the header for event
downloading.
Refer: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/40136
Tested:
Event entry data can be downloaded with the fix.
Change-Id: Ia45123340da79a54fc4229470e6822206b8df808
Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
diff --git a/src/store/modules/Logs/EventLogStore.js b/src/store/modules/Logs/EventLogStore.js
index f302dff..469aa26 100644
--- a/src/store/modules/Logs/EventLogStore.js
+++ b/src/store/modules/Logs/EventLogStore.js
@@ -222,7 +222,11 @@
},
async downloadEntry(_, uri) {
return await api
- .get(uri)
+ .get(uri, {
+ headers: {
+ Accept: 'application/octet-stream',
+ },
+ })
.then((response) => {
const blob = new Blob([response.data], {
type: response.headers['content-type'],