Преглед изворни кода

Merge branch 'master' into feat/GW-3658-can-use-GCP-from-db-vars

itizawa пре 5 година
родитељ
комит
fc7500aa8e

+ 1 - 1
src/client/js/components/PageEditor/DrawioModal.jsx

@@ -119,7 +119,7 @@ class DrawioModal extends React.PureComponent {
   get drawioURL() {
     const { config } = this.props.appContainer;
 
-    const drawioUri = config.env.DRAWIO_URI || 'https://www.draw.io/';
+    const drawioUri = config.env.DRAWIO_URI || 'https://embed.diagrams.net/';
     const url = new URL(drawioUri);
 
     // refs: https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported-

+ 7 - 0
src/server/middlewares/certify-shared-file.js

@@ -7,6 +7,13 @@ module.exports = (crowi) => {
 
   return async(req, res, next) => {
     const { referer } = req.headers;
+
+    // Attachments cannot be viewed by clients who do not send referer.
+    // https://github.com/weseek/growi/issues/2819
+    if (referer == null) {
+      return next();
+    }
+
     const { path } = url.parse(referer);
 
     if (!path.startsWith('/share/')) {