Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Extend isPrintable check to all keys with string values
  • Loading branch information
mbg committed Mar 9, 2026
commit 65f7f363021bd8835a60edb52bc57ae3834241ee
11 changes: 7 additions & 4 deletions lib/start-proxy-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions src/start-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,14 @@ export function getCredentials(
return str ? /^[\x20-\x7E]*$/.test(str) : true;
};

if (
!isPrintable(e.type) ||
!isPrintable(e.host) ||
!isPrintable(e.url) ||
!isPrintable(e.username) ||
!isPrintable(e.password) ||
!isPrintable(e.token)
) {
throw new ConfigurationError(
"Invalid credentials - fields must contain only printable characters",
);
// Ensure that all string fields only contain printable characters.
for (const key of Object.keys(e)) {
const val = e[key];
if (typeof val === "string" && !isPrintable(val)) {
throw new ConfigurationError(
"Invalid credentials - fields must contain only printable characters",
);
}
}

// If the password or token looks like a GitHub PAT, warn if no username is configured.
Expand Down