diff --git a/Dockerfile b/Dockerfile index c69029a5..b2c69e5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,5 +28,5 @@ ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar ENV PATH $PATH:$JAVA_HOME/bin ENV LANG zh_CN.UTF-8 ENV LC_ALL zh_CN.UTF-8 -ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-3.5/bin -ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-3.5/config/application.properties","-jar","/opt/kkFileView-3.5/bin/kkFileView-3.5.jar"] \ No newline at end of file +ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-3.5.1/bin +ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-3.5.1/config/application.properties","-jar","/opt/kkFileView-3.5.1/bin/kkFileView-3.5.1.jar"] \ No newline at end of file diff --git a/office-plugin/pom.xml b/office-plugin/pom.xml index 5972d733..bcce9a0b 100644 --- a/office-plugin/pom.xml +++ b/office-plugin/pom.xml @@ -7,7 +7,7 @@ filepreview cn.keking - 3.5 + 3.5.1 office-plugin diff --git a/pom.xml b/pom.xml index 2010031c..f8907832 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.keking filepreview - 3.5 + 3.5.1 1.8 diff --git a/server/pom.xml b/server/pom.xml index e4ddbf36..c441f616 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -6,7 +6,7 @@ filepreview cn.keking - 3.5 + 3.5.1 kkFileView diff --git a/server/src/main/bin/startup.bat b/server/src/main/bin/startup.bat index 74c115e9..93a1870b 100644 --- a/server/src/main/bin/startup.bat +++ b/server/src/main/bin/startup.bat @@ -6,4 +6,4 @@ echo Starting kkFileView... echo Please check log file in ../log/kkFileView.log for more information echo You can get help in our official homesite: https://kkFileView.keking.cn echo If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers -java -Dspring.config.location=..\config\application.properties -jar kkFileView-3.5.jar -> ..\log\kkFileView.log \ No newline at end of file +java -Dspring.config.location=..\config\application.properties -jar kkFileView-3.5.1.jar -> ..\log\kkFileView.log \ No newline at end of file diff --git a/server/src/main/bin/startup.sh b/server/src/main/bin/startup.sh index 224ccb0e..a5b5015e 100644 --- a/server/src/main/bin/startup.sh +++ b/server/src/main/bin/startup.sh @@ -29,4 +29,4 @@ echo "Starting kkFileView..." echo "Please execute ./showlog.sh to check log for more information" echo "You can get help in our official homesite: https://kkFileView.keking.cn" echo "If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers" -nohup java -Dfile.encoding=UTF-8 -Dspring.config.location=../config/application.properties -jar kkFileView-3.5.jar > ../log/kkFileView.log 2>&1 & +nohup java -Dfile.encoding=UTF-8 -Dspring.config.location=../config/application.properties -jar kkFileView-3.5.1.jar > ../log/kkFileView.log 2>&1 & diff --git a/server/src/main/java/cn/keking/web/filter/FilterConfiguration.java b/server/src/main/java/cn/keking/web/filter/FilterConfiguration.java index ba14b6c4..7a7505bd 100644 --- a/server/src/main/java/cn/keking/web/filter/FilterConfiguration.java +++ b/server/src/main/java/cn/keking/web/filter/FilterConfiguration.java @@ -30,8 +30,6 @@ public class FilterConfiguration { Set filterUri = new HashSet<>(); filterUri.add("/onlinePreview"); filterUri.add("/picturesPreview"); - filterUri.add("/getCorsFile"); - filterUri.add("/addTask"); TrustHostFilter filter = new TrustHostFilter(); FilterRegistrationBean registrationBean = new FilterRegistrationBean(); registrationBean.setFilter(filter); diff --git a/server/src/main/resources/static/pdfjs/web/viewer.js b/server/src/main/resources/static/pdfjs/web/viewer.js index 0b610687..1fef2f58 100644 --- a/server/src/main/resources/static/pdfjs/web/viewer.js +++ b/server/src/main/resources/static/pdfjs/web/viewer.js @@ -2019,7 +2019,7 @@ var validateFileURL; { var HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"]; - validateFileURL = function validateFileURL(file, base) { + validateFileURL = function validateFileURL(file) { if (file === undefined) { return; } @@ -2036,7 +2036,7 @@ var validateFileURL; protocol = _ref11.protocol; if (origin !== viewerOrigin && protocol !== "blob:") { - return (base.endsWith('/') ? base : base + '/') + 'getCorsFile?urlPath=' + encodeURIComponent(file); + throw new Error("file origin does not match viewer's"); } } catch (ex) { var message = ex && ex.message; @@ -2089,14 +2089,12 @@ function loadAndEnablePDFBug(enabledTabs) { function webViewerInitialized() { var appConfig = PDFViewerApplication.appConfig; var file; - var base; var disableDownload; var queryString = document.location.search.substring(1); var params = (0, _ui_utils.parseQueryString)(queryString); file = "file" in params ? params.file : _app_options.AppOptions.get("defaultUrl"); - base = 'base' in params ? params.base : appConfig.defaultUrl; disableDownload = 'disabledownload' in params ? params.disabledownload : 'false'; - validateFileURL(file, base); + validateFileURL(file); var fileInput = document.createElement("input"); fileInput.id = appConfig.openFileInputName; fileInput.className = "fileInput"; diff --git a/server/src/main/resources/web/pdf.ftl b/server/src/main/resources/web/pdf.ftl index f192527b..fa0167e7 100644 --- a/server/src/main/resources/web/pdf.ftl +++ b/server/src/main/resources/web/pdf.ftl @@ -21,7 +21,12 @@