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

Hello, I'm trying to call /api/get-resources as application alone. However this api does not act the same as other resource apis like /api/get-resource or /api/upload-resource. /api/get-resources calls ApiController.RequireSignedInUser() to auth, which blocks application auth header to access this api (err msg: The user: app/app-built-in doesn't exist). How should casdoor application call /api/get-resources?

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?