-
Notifications
You must be signed in to change notification settings - Fork 67
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
[BUG]: upload note return server internal error #24
Comments
@zephyrpathsofglory, Have you made sure you passed in the file? If possible, can you send me the request body so that I can better locate the error. Thanks your issue! |
It seems that my file has not uploaded? |
You can try to pull the latest code, and then try to upload note to see if this happens again. it's really weird. |
I have pulled the latest code, rebuilt the docker images, and restarted the docker-compose servers. But still got the same error. |
okay, I think the problem should be in the frontend, give me some time to find where the problem is. |
@zephyrpathsofglory, hi, I should know what the problem is, is the MIME type of the file you uploaded |
The uploaded file is a README file with md extension downloaded from github. The mime type of this file is |
Yeah its not allowed. detectLegalFile You can see the logic in this code. I have modified the logic of not terminating the upload after reporting an error and will update it immediately. |
…loading the wrong file type [BUG]: upload note return server internal error #24
fix: fixed an issue where the upload event was not terminated when uploading the wrong file type #24
Why not check file type by file extensions? |
Because MIME types provide more accurate information about the file's content, are more secure, have better cross-platform compatibility, and are less susceptible to manipulation by malicious users. |
Thank you, but not all md file is text/markdown. It will fail the upload with a good chance. |
What you said is correct. I will add more type judgments after trying it later. Thank you very much for your issue and follow! If you have any suggestions in the future, you can also submit an issue or PR ~ |
Description of the bug
I uploaded a
md
file but the server returned 500, and the following is the log of server:Environment:
The text was updated successfully, but these errors were encountered: