Fix backslashes being accepted by sanitizeArtifactName
This commit is contained in:
parent
7fd62151d9
commit
1eab40885f
6 changed files with 9 additions and 4 deletions
|
|
@ -18,6 +18,10 @@ test("sanitizeArtifactName", (t) => {
|
|||
debugArtifacts.sanitizeArtifactName("*m)a&n^y%i££n+v!a:l[i]d"),
|
||||
"manyinvalid",
|
||||
);
|
||||
t.deepEqual(
|
||||
debugArtifacts.sanitizeArtifactName("\\foo\\bar//baz"),
|
||||
"foobarbaz",
|
||||
);
|
||||
});
|
||||
|
||||
// These next tests check the correctness of the logic to determine whether or not
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import {
|
|||
} from "./util";
|
||||
|
||||
export function sanitizeArtifactName(name: string): string {
|
||||
return name.replace(/[^a-zA-Z0-9_\\-]+/g, "");
|
||||
return name.replace(/[^a-zA-Z0-9_-]+/g, "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue