Skip to content

Correctly handle multipart/form-data rather than application/octet-stream #19

Open

Description

@DavidGarfinkle

currently, just a piece ID and the symbolic data is stored, but no metadata

Activity

  1. DavidGarfinkle commented on Aug 22, 2019

    @DavidGarfinkle
    CollaboratorAuthor

    add author and piece name

  2. DavidGarfinkle commented on Sep 2, 2019

    @DavidGarfinkle
    CollaboratorAuthor

    i attempted to implement this correctly by handling a Content-Type: multipart/form-data MIMETYPE as specified by RFC 2388 and implemented in requests and flask

    after two hours I gave up because the werkzeug.Request.files and werkzeug.Request.form attributes were always empty, similar but not identical to the following github issues:

    Instead, I implemented this by handling ONLY mimetype application/octet-stream (binary data) and requiring the following binary payload:

    1. JSON metadata encoded in UTF8
    2. hardcoded random 16-byte separator value 90dc2e88fb6b4777432355a4bc7348fd17872e78905a7ec6626fe7b0f10a2e5a
    3. Musical data to be parsed by music21
  3. changed the title [-]accept metadata on POST /index[/-] [+]Correctly handle `multipart/form-data` rather than `application/octet-stream`[/+] on Sep 2, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions