Skip to content
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

@uppy/companion: do not use unsafe call to JSON.stringify #5422

Merged
merged 2 commits into from
Aug 29, 2024
Merged
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
3 changes: 2 additions & 1 deletion packages/@uppy/companion/src/server/emitter/redis-emitter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { EventEmitter } = require('node:events')
const util = require('node:util')

const logger = require('../logger')

Expand Down Expand Up @@ -141,7 +142,7 @@ module.exports = (redisClient, redisPubSubScope) => {
* @param {string} eventName name of the event
*/
function emit (eventName, ...args) {
runWhenConnected(() => publisher.publish(getPrefixedEventName(eventName), JSON.stringify(args)))
runWhenConnected(() => publisher.publish(getPrefixedEventName(eventName), util.inspect(args)))
}

/**
Expand Down
Loading