Skip to content

Add file extension to match content-type #146

Closed

Description

@jvherweg

When doing a PUT/POST to a file store we should make sure that the resource has the correct extension so the content-type remains the same when reading out the data again. See the comments here.

Activity

  1. added
    🐛 bug
    on Sep 10, 2020
  2. jvherweg commented on Sep 22, 2020

    @jvherweg
    MemberAuthor

    Related to this:

    • Do we want to reject PUTs to URIs that do not have an extension that matches their content-type when creating a new resource?
    • Do we want to reject PUTs to URIs that already exist if the new content-type doesn't match the extension (and thus the currently stored content-type)?
  3. added
    ❓question
    on Sep 22, 2020
  4. RubenVerborgh commented on Sep 22, 2020

    @RubenVerborgh
    Member

    Do we want to reject PUTs to URIs that do not have an extension that matches their content-type when creating a new resource?

    No, putting Turtle to /foo.json gets foo.json$.ttl on disk as per https://www.w3.org/DesignIssues/HTTPFilenameMapping.html

    Do we want to reject PUTs to URIs that already exist if the new content-type doesn't match the extension (and thus the currently stored content-type)?

    The $ extension would change or be added/removed accordingly.

    The above all assuming that we follow the "content type is encoded/reflected in the extension" approach of https://www.w3.org/DesignIssues (different mappers can implement different things)

  5. jvherweg commented on Sep 22, 2020

    @jvherweg
    MemberAuthor

    Ah yea, for some reason I always missed so far that the file name doesn't exactly match the end of the URI, really should read more carefully sometimes 😂

  6. removed
    ❓question
    on Sep 30, 2020
  7. jvherweg commented on Oct 14, 2020

    @jvherweg
    MemberAuthor

    Partially supported now. Still need to add some checks when the incoming content-type is different from the already stored file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions