Skip to content

Support HEAD requests (and return MIME type) on attachment download endpoint #49

@rudokemper

Description

@rudokemper

Currently, the /projects/:projectPublicId/attachments/:driveDiscoveryId/:type/:name endpoint does not support HEAD requests. This results in a 502 Bad Gateway when attempting to fetch just the headers (e.g. using curl -I), even though GET works fine.

HEAD requests would be useful for retrieving the MIME type of files. Since the CoMapeo API serves attachments without file extensions, it seems otherwise impossible to determine the MIME type without downloading the full file. For clients like ours that regularly pull data from comapeo-cloud, this leads to unnecessary bandwidth usage through needing to re-download files we already have, or requires a cumbersome workaround of scanning an attachments/ directory and comparing file stems to avoid duplicates.

To be clear: we have already implemented the latter workaround on our end, and are not blocked by this issue. But still wanted to file this as it would be a nice feature to support, and likely useful for others.

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