Skip to content

Commit

Permalink
Merge pull request #1194 from dbauszus-glx/query-substitute-error
Browse files Browse the repository at this point in the history
Throw error for invalid query parameter substitution
  • Loading branch information
RobAndrewHurst authored Mar 22, 2024
2 parents c7c0baf + a851c07 commit 6951494
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mod/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ module.exports = async (req, res) => {
// Change value may only contain a limited set of whitelisted characters.
if (!reserved.has(param) && !/^[A-Za-z0-9,"'._-\s]*$/.test(change)) {

// Err and return empty string if the change value is invalid.
console.error('Change param no bueno')
return ''
throw new Error(`Substitute \${${param}} value rejected: ${change}`);
}

return change
Expand Down

0 comments on commit 6951494

Please sign in to comment.