Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dev): allow specify apiBaseUrl testing, allow CROS origin in co… #2040

Closed
wants to merge 1 commit into from

Conversation

xuefer
Copy link
Contributor

@xuefer xuefer commented Mar 31, 2024

…nfig

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Docs
  • Refactor/Code Cleanup

Description

allow frontend page (running on development pc) to cross use backend running on robot device, by "apiBaseUrl=http://roboturl"
for new roborock robots, it's not easy to make the robot connect valetudo cloud running outside of robot (development PC), because rootfs is readonly, mount bind is disabled, and ip is checked

…nfig

Signed-off-by: Xuefer <xuefer@gmail.com>
this.app.use(function (req, res, next) {
const origin = req.headers["origin"];
if (origin?.startsWith(self.webserverConfig.allowOrigin)) {
res.setHeader("Access-Control-Allow-Origin", origin);

Check failure

Code scanning / CodeQL

CORS misconfiguration for credentials transfer High

Credential
leak vulnerability due to a
misconfigured CORS header value
.
@Hypfer Hypfer closed this Mar 31, 2024
@xuefer xuefer deleted the api-baseurl branch June 15, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants