satorumurmur / bibi

Bibi | EPUB Reader on your website.
https://bibi.epub.link
MIT License
833 stars 123 forks source link

happy new year,how i cross domain use the bibireader #107

Open txb2d opened 3 years ago

txb2d commented 3 years ago

e.g:http://www.lsjxw.cn/res/txb/js/epubreader/bibi/index.html?book=http://kod.ls123.site/txbmicloudWP4rvk20200829213816.epub the console: Access to XMLHttpRequest at 'http://kod.ls123.site/txbmicloudWP4rvk20200829213816.epub/META-INF/container.xml' from origin 'http://www.lsjxw.cn' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. bibi.js:11 Failed to open the book (as a file: Data Invalid / as a folder: Probably CORS Blocked) log @ bibi.js:11 U.error @ bibi.js:11 Promise.catch (async) x.hello @ bibi.js:11 (anonymous) @ bibi.js:11 document.addEventListener.e @ bibi.js:11 (anonymous) @ bibi.js:11 bibi.js:11 GET http://kod.ls123.site/txbmicloudWP4rvk20200829213816.epub/META-INF/container.xml net::ERR_FAILED (anonymous) @ bibi.js:11 U.download @ bibi.js:11 s @ bibi.js:11 (anonymous) @ bibi.js:11 Promise.catch (async) or @ bibi.js:11 (anonymous) @ bibi.js:11 initializeBook @ bibi.js:11 (anonymous) @ bibi.js:11 Promise.then (async) x.loadBook @ bibi.js:11 Promise.then (async) x.hello @ bibi.js:11 (anonymous) @ bibi.js:11 document.addEventListener.e @ bibi.js:11 (anonymous) @ bibi.js:11

the curl: curl -I http://kod.ls123.site/txbmicloudWP4rvk20200829213816.epub HTTP/1.1 200 OK Server: nginx/1.16.1 Date: Fri, 01 Jan 2021 02:47:24 GMT Content-Type: application/epub+zip Content-Length: 149803 Last-Modified: Sat, 26 Dec 2020 13:58:17 GMT Connection: keep-alive ETag: "5fe74179-2492b" Access-Control-Allow-Origin: * Accept-Ranges: bytes

but the same file if not in other domain display well http://www.lsjxw.cn/res/txb/js/epubreader/bibi/index.html?book=http://www.lsjxw.cn/txbmicloudWP4rvk20200829213816.epub the console Bibi: 📕 Hello! (v1.2.0) the curl curl -I http://www.lsjxw.cn/txbmicloudWP4rvk20200829213816.epub HTTP/1.1 200 OK Server: nginx/1.16.1 Date: Fri, 01 Jan 2021 03:07:30 GMT Content-Type: application/epub+zip Content-Length: 149803 Last-Modified: Thu, 31 Dec 2020 17:52:26 GMT Connection: keep-alive ETag: "5fee0fda-2492b" Access-Control-Allow-Origin: * Accept-Ranges: bytes

i want to get the auther 's help!!!!!!!thanks

txb2d commented 3 years ago

why the "META-INF/container.xml" add to the bottom!?????

txb2d commented 3 years ago

who can give me a success e.g of the cross domain use the ngnix

WeCre8Dev commented 3 years ago

why the "META-INF/container.xml" add to the bottom!?????

I have set the CORS settings on my DigitalOcean Spaces and yet it didn't work for me. please help me. why request adding /META-INF/container.xml to the end of epub file url?