Skip to contentSkip to conversation

Phosphor Web-ui: Server unreachable - cross origin request blocked

DISCUSSION Joseph Reynolds 1 participant 1 message Aug 7, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 19 lines · AKASH

Message: 4
Date: Tue, 7 Aug 2018 15:43:21 +0530
From: AKASH G J <[email protected]>
To: Ed Tanous <[email protected]>
Cc: [email protected]
Subject: Re: Phosphor Web-ui: Server unreachable
Message-ID:
<CAE33tLHsd5HwrCS9qLXO6Mo_gzka1Mrv7vs3Ofy0AF=YRJdT1w@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Ed,

Sorry for the late reply. I was on leave for last week.

I am hosting phosphor-webui on a different machine and trying to connect the BMC board using its IP address. I am using bmcweb platform. When I tried to login, the following message appeared in browser console.

Quoted 8 lines

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://<BMC-IP>/login. (Reason: CORS request did not succeed).
<unavailable> activity-stream.bundle.js:3170:9
CSI/tbsd_ cb=gapi.loaded_0:458:127
CSI/_tbnd cb=gapi.loaded_0:458:127
CSI/tbsd_ cb=gapi.loaded_0:458:127
CSI/_tbnd cb=gapi.loaded_0:458:127

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin.
I think the HTTP response header from phosphor-webui needs to include "Cross-origin resource sharing" headers such as:
Access-Control-Allow-Origin: <YOUR-WEB-HOSTING-MACHINE-IP>, <original-ip>    <-- or use * Access-Control-Allow-Credentials: true
  Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
  Access-Control-Max-Age: 3600
  Access-Control-Allow-Headers: Content-Type, Accept, X-Requested-With, remember-me

How would we enhance the phosphor-webui application to produce these headers?

Quoted 4 lines

Thanks and Regards,

Akash
[...snip...]