Merge pull request #8 from gustavotrott/pr-15990-ppt-fix

Add exception to accept ppt with pptx mime
This commit is contained in:
Guilherme Pereira Leme 2022-11-25 11:01:06 -03:00 committed by GitHub
commit 6d1c7f6bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -44,8 +44,14 @@ public class MimeTypeUtils {
};
public Boolean extensionMatchMimeType(String mimeType, String finalExtension) {
if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase())) {
return EXTENSIONS_MIME.get(finalExtension.toLowerCase()).equalsIgnoreCase(mimeType);
if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase()) &&
EXTENSIONS_MIME.get(finalExtension.toLowerCase()).equalsIgnoreCase(mimeType)) {
return true;
} else if(EXTENSIONS_MIME.containsKey(finalExtension.toLowerCase() + 'x') &&
EXTENSIONS_MIME.get(finalExtension.toLowerCase() + 'x').equalsIgnoreCase(mimeType)) {
//Exception for MS Office files named with old extension but using internally the new mime type
//e.g. a file named with extension `ppt` but has the content of a `pptx`
return true;
}
return false;

View File

@ -45,7 +45,6 @@ import org.bigbluebutton.web.services.turn.RemoteIceCandidate
import org.json.JSONArray
import javax.servlet.ServletRequest
import java.util.regex.*
class ApiController {
private static final Integer SESSION_TIMEOUT = 14400 // 4 hours