Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DavidGarfinkle opened this issue Aug 15, 2019 · 2 comments

Comments

@DavidGarfinkle
Copy link
Collaborator

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

@DavidGarfinkle
Copy link
Collaborator Author

add author and piece name

@DavidGarfinkle
Copy link
Collaborator Author

DavidGarfinkle commented Sep 2, 2019

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

@DavidGarfinkle DavidGarfinkle changed the title accept metadata on POST /index Correctly handle multipart/form-data rather than application/octet-stream Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants