fix: Diagrams.net proxy path considered as embeddable
This commit is contained in:
@@ -11,6 +11,12 @@ describe("Diagrams", () => {
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to not be enabled on the proxy path", () => {
|
||||
expect("https://app.diagrams.net/proxy?url=malicious".match(match)).toBe(
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://app.diagrams.net/#ABCDefgh_A12345-6789".match(match)).toBe(
|
||||
null
|
||||
|
||||
@@ -3,7 +3,7 @@ import Frame from "../components/Frame";
|
||||
import Image from "../components/Image";
|
||||
import { EmbedProps as Props } from ".";
|
||||
|
||||
const URL_REGEX = /^https:\/\/viewer\.diagrams\.net\/.*(title=\\w+)?/;
|
||||
const URL_REGEX = /^https:\/\/viewer\.diagrams\.net\/(?!proxy).*(title=\\w+)?/;
|
||||
|
||||
export default class Diagrams extends React.Component<Props> {
|
||||
static ENABLED = [URL_REGEX];
|
||||
|
||||
Reference in New Issue
Block a user