Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Normalize `git://` repository URLs for Discord links in `npm` command
- Optimize `run` command and expand its judge0 language alias map
- Harden `http` command against SSRF and DoS
- Fix reDoS risk from unrestricted user-controlled RegExp

### Contributors

Expand Down Expand Up @@ -42,7 +43,7 @@
- **Security Auditing**: Embedded a URL inspection utility to evaluate links for potential safety risks.
- **Community-Tier Access**: Implemented a server-membership verification system to seamlessly unlock premium commands for community supporters.

### contributors
### Contributors

- [@calebephrem](https://github.com/calebephrem)
- [@joshdegr8](https://github.com/joshdegr8)
Expand Down
15 changes: 9 additions & 6 deletions src/commands/tools/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ function matchWithTimeout(
finish(() => reject(new Error("timeout")));
}, timeoutMs);

worker.on("message", (msg: { ok: boolean; results?: MatchResult[]; error?: string }) => {
finish(() => {
if (msg.ok) resolve(msg.results ?? []);
else reject(new Error(msg.error || "regex error"));
});
});
worker.on(
"message",
(msg: { ok: boolean; results?: MatchResult[]; error?: string }) => {
finish(() => {
if (msg.ok) resolve(msg.results ?? []);
else reject(new Error(msg.error || "regex error"));
});
},
);

worker.on("error", (err) => {
finish(() => reject(err));
Expand Down
Loading