forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Special characters being removed during collectio import
Instead of using a strict sanitization regex in the frontend the importer will now sanitize the filename before writing it to disk. Should fix: - usebruno#1779 - usebruno#1587 - usebruno#671 - usebruno#1274
- Loading branch information
1 parent
bf3d3ca
commit eb638db
Showing
4 changed files
with
10 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
// See https://github.com/usebruno/bruno/pull/349 for more info | ||
// Scrict regex for validating directories. Covers most edge cases like windows device names | ||
export const dirnameRegex = /^(?!CON|PRN|AUX|NUL|COM\d|LPT\d|^ |^\-)[^<>:"/\\|?*\x00-\x1F]+[^\. ]$/; | ||
// Strict regex for validating directories. Covers most edge cases like windows device names | ||
export const dirnameRegex = /^(?!CON|PRN|AUX|NUL|COM\d|LPT\d|^ |^-)[^<>:"/\\|?*\x00-\x1F]+[^\. ]$/; | ||
// Not so strict Regex for filenames, because files normally get a extension e.g. ".bru" and are not affect by | ||
// windows special names e.g. CON, PRN | ||
export const filenameRegex = /[<>:"/\\|?*\x00-\x1F]/; | ||
|
||
export const variableNameRegex = /^[\w-.]*$/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters