-
Notifications
You must be signed in to change notification settings - Fork 46
Escape marketplace search filters #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| import { describe, it, expect } from "vitest"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import { sanitizeUrlParam, sanitizeSearchParams } from "./sanitize"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import { escapePostgrestSearchValue, sanitizeUrlParam, sanitizeSearchParams } from "./sanitize"; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| describe("sanitizeUrlParam", () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| it("should return empty string for null/undefined input", () => { | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -51,3 +51,11 @@ describe("sanitizeSearchParams", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| expect(sanitizeSearchParams(url, "missing")).toBe(""); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| describe("escapePostgrestSearchValue", () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| it("escapes LIKE wildcards and PostgREST filter punctuation", () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| expect(escapePostgrestSearchValue("100%_match,(v1.2)")).toBe( | ||||||||||||||||||||||||||||||||||||||||||||||
| "100\\%\\_match\\,\\(v1\\.2\\)" | ||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"100%_mcp,(v1.2)"— themcpsubstring is copy-pasted from the MCP route test and is semantically confusing in a skills test. Renaming it to something skills-related keeps the test self-documenting.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!