Skip to content

MulterOptions required when having securityHandlers  #226

@comino

Description

@comino

Updating from 2.13.x to 2.15 and also 3.x causes an error message on startup:
"Error: multerOpts must be an object or undefined"

index.js:

validateOptions(options) {
        // ...... 
        const multerOpts = options.multerOpts;
        if (securityHandlers != null) {
            if (typeof multerOpts !== 'object' || Array.isArray(securityHandlers)) {
                throw ono_1.default('multerOpts must be an object or undefined');
            }
            util_1.deprecationWarning('multerOpts is deprecated. Use fileUploader instead.');
        }
       // .....

I don't really understand why we would check for "securityHandlers" at that place. I assume the author meant to check multerOpts instead so like:

validateOptions(options) {
        // ...... 
        const multerOpts = options.multerOpts;
        if (multerOpts != null) {
            if (typeof multerOpts !== 'object' || Array.isArray(multerOpts)) {
                throw ono_1.default('multerOpts must be an object or undefined');
            }
            util_1.deprecationWarning('multerOpts is deprecated. Use fileUploader instead.');
        }
       // .....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions