Closed superruzafa closed 2 years ago
Hi @superruzafa! This is an interesting feature, but I see some potential issues:
Because of the above, this PR cannot be merged in such an implementation
Ok, thanks for the explanation.
What about to limit the size of the contents the user can upload? For fonts let's say... 300 Kb?
And regarding the disk space, what about to delete the uploaded file once its contents have been loaded into the Carbon page?
It's still about uploading some files on the server. And files can be anything.
I think we can pass a link to a font in the body payload. Or even base64 encoded font.
I reverted the file upload thing and allowed the user to specify the font encoded in base64.
Great! Should we use multipart and formidable now? We can pass base64 in JSON.
Could you please make rebase for tests passing and add a test case for custom font?
Using multipart/form-data
is just to have an easier way (for me) to construct the curl
command in CLI without mess with the JSON string, but if you prefert to get rid of it please let me know and I'll remove it from the PR.
Additionally let me add a test case and fix the test.
Ok, good point about curl. I think multipart can be kept, but it requires some tests too.
@petersolopov, can you please review this PR?
I didn't notice there was a Dockerfile in the project to run the tests so I was using a custom one, now all the tests pass.
I didn't notice there was a Dockerfile in the project to run the tests so I was using a custom one, now all the tests pass.
There is Dockerfile 🙂
Merged. @superruzafa thanks a lot!
Hi.
With this PR the
/api/cook
endpoint also acceptsmultipart/form-data
which allows to upload custom fonts for rendering code snippets.