-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Accept the path to a bom file (in the /scan endpoint) while running dep-scan in the server mode #169
Accept the path to a bom file (in the /scan endpoint) while running dep-scan in the server mode #169
Conversation
2fe8d0e
to
449ee7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just some minor comments
a0da297
to
0846e17
Compare
|
||
if uploaded_bom_file.get('file', None) is not None: | ||
bom_file = uploaded_bom_file['file'] | ||
bom_file_content = bom_file.read().decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point the uploaded file could be of any extension including videos and binaries. Is there another eay to configure quart to only accept specific mimetypes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, the mime-type of a file is interpreted as a binary blob of data, and the mime-type is set to application/octet-stream
. Hence, filtering (or accepting) the input files based on their mime-types is difficult.
Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
0846e17
to
5fa0a1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Could you also add a curl example to the readme to show the upload in action?
curl -F 'file=@/tmp/bom.json'
I've created a PR (#172) to update the README. |
Reference Issue: #157