Skip to content

Commit

Permalink
Fix simx path formatting issue (#10229)
Browse files Browse the repository at this point in the history
* fix path formatting issue

* simpler fix

* restore comment
  • Loading branch information
eanders-ms authored Oct 11, 2024
1 parent e1b9341 commit 7c79622
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pxtsim/simdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ namespace pxsim {
const simPath = simUrl.pathname.replace(/---?.*/, "");
// Construct the path. The "-" element delineates the extension key from the resource name.
const simxPath = [simPath, "simx", key, "-", simx.index].join("/");
simx.url = new URL(simxPath, simUrl.origin).toString();
// Create the fully-qualified URL, preserving the origin by removing all leading slashes
simx.url = new URL(simxPath.replace(/^\/+/, ""), simUrl.origin).toString();
}

// Add the origin to the allowed origins
Expand Down

0 comments on commit 7c79622

Please sign in to comment.