Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum

I found that Casdoor /api/upload-resource checks the "fullFilePath" query param and force convers its ext name to mime type, then parsed it as the"file_type" field. And app panics if mime type is not properly mapped. SoI'm thinking is this function, or the "file_type" field necessary?

I mean, casdoor acts as a redirector to provide files, right? So the file_type field means noting when getting files, because it contributes noting to the "Content-Type" response header.

For those files have extension name popular to users, its type is easily judged by fullpath field. And conversely, I think casdoor should allow application to upload resource without checks about extension name. /api/upload-resource api fails due to file extension name not polular enough for casdoor is..... unreasonable, I think.

What do you guys think of this?

2views
2users
1 minread

Good point. The file ext is just used to preview in Resources tab. It should let unknown ext pass

Can you make a PR to fix it?

1 / 3
Jul 2023