Skip to content

Binary files are corrupted in dev mode #1636

@Toub

Description

@Toub

Binary files dynamically generated and downloaded from the api are corrupted, due to connect-livereload trying to inject code into the binary.

The issue is discussed here: intesso/connect-livereload#39

This can be fixed by configuring connect-livereload to ignore /api path in server/config/express.js:

if ('development' === env) {
        app.use(require('connect-livereload')({
            ignore: [/^\/api\/(.*)/,
                /\.js(\?.*)?$/, /\.css(\?.*)?$/, /\.svg(\?.*)?$/, /\.ico(\?.*)?$/, /\.woff(\?.*)?$/,
                /\.png(\?.*)?$/, /\.jpg(\?.*)?$/, /\.jpeg(\?.*)?$/, /\.gif(\?.*)?$/, /\.pdf(\?.*)?$/
              ]
        }));
    }

To reproduce, simply download a binary from the api using res.download.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions