rookie0 / nextcloud-sharing-path

🌩 Nextcloud app to enhance files sharing to be accessed by stored path, can be used as CDN origin.
GNU Affero General Public License v3.0
48 stars 11 forks source link

Still have the same issue that the endless 302 redirect happens #3

Closed Y2Nk4 closed 5 years ago

Y2Nk4 commented 5 years ago

I tried to use nextcloud as a CDN server which is also what this plugin doing. When I was using the official function, adding "/download" at the end of the share link and put it in the video tag in a web page, it will cause an endless 302 redirect as what this issue is talking about. https://github.com/nextcloud/server/issues/542

So I tried this plugin, but still, the endless 302 redirects are still happening. So I wanna check if there is any way to fix this problem.

rookie0 commented 5 years ago

Please check the sharing path can be accessed first.

Then check your access.log to find the request detail, maybe failed at CDN and did not reach your nextcloud server.

Y2Nk4 commented 5 years ago

Yes, the link cloud be accessed by a browser, or be downloaded directly, but when I embed it in the video tag in html, it will show an endless 302 redirect. I think this is because of the nextcloud itself.

Y2Nk4 commented 5 years ago

You could check this issue in NextCloud repo to see, https://github.com/nextcloud/server/issues/542

Y2Nk4 commented 5 years ago

哦 我懂你意思了,这个插件是把NextCloud当成CDN源站用。我以为是用于创建直链分享的。想多了hh

Y2Nk4 commented 5 years ago

NextCloud文件分享+/download的直链扔在html的video标签无法查看,会导致循环302。只能想其他办法解决了

rookie0 commented 5 years ago

循坏 302 是由于 Nextcloud 的安全策略,看 nextcloud/server#2523 是修复了,具体不清楚,应该是需要在哪里进行配置

简单粗暴的话,可以在 apps/files_sharing/lib/Controller/ShareController.php 中给方法 downloadShare 添加注释 @NoSameSiteCookieRequired

当然,也可以直接用这个插件,加个CDN域配置回源就行

Y2Nk4 commented 5 years ago

好的,我看看