Coder Social home page Coder Social logo

corsblogfetch's Introduction

Blog -- CORS 版

首先得再

本站存取 172.104.100.202 將本程式執行起來

$ deno run -A app.js

結果

CORS 存取

瀏覽器還是認為這不安全,但可以執行!

不過如果瀏覽靜態網頁,則沒有被認為不安全

bug

在 localhost run 時會出現

$ deno run -A app.js
CORS-enabled origin :  *
Server run at https://localhost:8001
[uncaught application error]: Http - error writing a body to connection: received fatal alert: CertificateUnknown: received fatal alert: CertificateUnknown

    at async HttpConn.nextRequest (ext:deno_http/01_http.js:108:21)
    at async serve (https://deno.land/x/[email protected]/http_server_native.ts:112:34)
[uncaught application error]: Http - error writing a body to connection: received fatal alert: CertificateUnknown: received fatal alert: CertificateUnknown

在 linode 時也會

root@fqdn:~/corsBlogFetch# deno run -A app.js
CORS-enabled origin :  *
Server run at https://localhost:8001
TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: CertificateUnknown,
}
TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: CertificateUnknown,
}

denoland/deno#18217 這篇文章中,建議用下列方式解決

  • bartlomieju commented on Mar 16
    • I believe you should be able to disable it with --unsafely-ignore-certificate-errors
    • 但我測試無效
  • jiawei397 commented on Mar 18
    • Local development uses mkcert to solve this problem, so close it. Everyone who need it can also use it , very good.
    • 尚未測試

corsblogfetch's People

Contributors

ccckmit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.