Skip to content

Commit 068a2b0

Browse files
joehanyuchenshi
andauthored
Block web browser requests to export endpoint (#6944)
* Block web browser requests to export endpoint * Update src/emulator/hub.ts Co-authored-by: Yuchen Shi <[email protected]> --------- Co-authored-by: Yuchen Shi <[email protected]>
1 parent dbb8573 commit 068a2b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/emulator/hub.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ export class EmulatorHub extends ExpressBasedEmulator {
9898
});
9999

100100
app.post(EmulatorHub.PATH_EXPORT, async (req, res) => {
101+
if (req.headers.origin) {
102+
res.status(403).json({
103+
message: `Export cannot be triggered by external callers.`,
104+
});
105+
}
101106
const path: string = req.body.path;
102107
const initiatedBy: string = req.body.initiatedBy || "unknown";
103108
utils.logLabeledBullet("emulators", `Received export request. Exporting data to ${path}.`);

0 commit comments

Comments
 (0)