Skip to content

Wrong mime type for fsevents.node #414

@Drarig29

Description

@Drarig29

My node_modules contain the fsevents package, which depends on the host architecture.

The generated [Content-Types].xml file (extracted from the VSIX extension) contains the following:

<Override ContentType="text/plain" PartName="/datadog-ci/node_modules/fsevents/LICENSE"/>
<Override ContentType="arm64):&#x9;application/x-mach-binary" PartName="/datadog-ci/node_modules/fsevents/fsevents.node"/>

You can see the mime type is wrong here, and because of this it's impossible to upload the VSIX file.
I get the following error when trying to upload:

A token is not valid. Refer to RFC 2616 for correct grammar of content types

Here is the output of the file --mime-type command:

datadog-ci/node_modules/fsevents/fsevents.node: application/x-mach-binary
datadog-ci/node_modules/fsevents/fsevents.node (for architecture x86_64):       application/x-mach-binary
datadog-ci/node_modules/fsevents/fsevents.node (for architecture arm64):        application/x-mach-binary

Temporary workaround

# Only extract the problematic file, and fix it with `sed`.
unzip -p $EXTENSION_FILENAME '\[Content_Types\].xml' | sed 's/arm64):&#x9;//' > '[Content_Types].xml'

# Update the problematic file with the fixed one.
zip $EXTENSION_FILENAME '[Content_Types].xml'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions