-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webui: Unquote clp queries before submitting them to the backend (fixes
- Loading branch information
1 parent
55f2a17
commit c158852
Showing
8 changed files
with
139 additions
and
3 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 |
---|---|---|
|
@@ -29,12 +29,16 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
meteortesting:[email protected] | ||
meteortesting:[email protected] | ||
meteortesting:[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
@@ -68,5 +72,6 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Enum for the CLP package's possible storage engines. These must match the values in | ||
* clp_py_utils.clp_config.StorageEngine. | ||
* @enum {string} | ||
*/ | ||
const CLP_STORAGE_ENGINES = Object.freeze({ | ||
CLP: "clp", | ||
CLP_S: "clp-s" | ||
}); | ||
|
||
export {CLP_STORAGE_ENGINES}; |
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import assert from "assert"; | ||
|
||
import {unquoteString} from "/imports/utils/misc"; | ||
|
||
describe("misc", function () { | ||
it("unquoteString", function () { | ||
// Empty string | ||
assert.strictEqual(unquoteString("", '"', '\\'), ""); | ||
// Unquoted string | ||
assert.strictEqual(unquoteString("abc", '"', '\\'), "abc"); | ||
// Double-quoted string | ||
assert.strictEqual(unquoteString("\"abc\"", '"', '\\'), "abc"); | ||
// Single-quoted string | ||
assert.strictEqual(unquoteString("'abc'", "'", '\\'), "abc"); | ||
// With escaped characters | ||
assert.strictEqual(unquoteString("a\\\\b\\\"c\\*\\?", '"', '\\'), "a\\\\b\"c\\*\\?"); | ||
// Double-quoted with escaped characters | ||
assert.strictEqual(unquoteString("\"a\\\\b\\\"c\\*\\?\"", '"', '\\'), "a\\\\b\"c\\*\\?"); | ||
|
||
// With one of the quotes missing | ||
assert.throws(() => { | ||
unquoteString("\"abc", '"', '\\'); | ||
}, Error); | ||
assert.throws(() => { | ||
unquoteString("abc\"", '"', '\\'); | ||
}, Error); | ||
|
||
// With an unescaped quote in the middle | ||
assert.throws(() => { | ||
unquoteString("ab\"c", '"', '\\'); | ||
}, Error); | ||
assert.throws(() => { | ||
unquoteString("\"ab\"c\"", '"', '\\'); | ||
}, Error); | ||
}); | ||
}); |