Can I change all my http:// links to just //?

后端 未结 7 1498
后悔当初
后悔当初 2020-11-22 01:12

Dave Ward says,

It’s not exactly light reading, but section 4.2 of RFC 3986 provides for fully qualified URLs that omit protocol (the HTTP or HTTPS) a

7条回答
  •  爱一瞬间的悲伤
    2020-11-22 01:35

    If you would like to make sure all requests are upgraded to secure protocol then there is simple option to use Content Security Policy header upgrade-insecure-requests

    Content-Security-Policy: upgrade-insecure-requests;
    

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests

提交回复
热议问题