We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
跨域资源共享 CORS 详解
彻底搞懂TCP协议:从 TCP 三次握手四次挥手说起
关于 HTTP 307 状态码
var request = new XMLHttpRequest(); // 创建XMLHttpRequest对象 //ajax是异步的,设置回调函数 request.onreadystatechange = function () { // 状态发生变化时,函数被回调 if (request.readyState === 4) { // 成功完成 // 判断响应状态码 if (request.status === 200) { // 成功,通过responseText拿到响应的文本: return success(request.responseText); } else { // 失败,根据响应码判断失败原因: return fail(request.status); } } else { // HTTP请求还在继续... } } // 发送请求: request.open('GET', '/api/categories'); request.setRequestHeader("Content-Type", "application/json") //设置请求头 request.send();//到这一步,请求才正式发出
如何防止CSRF攻击? Prevent XSS and CSRF attacks on your website
HttpOnly
document.cookie
Content-Security-Policy: default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report
X-XSS-Protection: 1; mode=block
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.跨域
跨域资源共享 CORS 详解
目的:兼容表单,主要表单可以发Ajax就能发。
方法:请求头中增加一个origin字段。
默认不发送cookie,若发送则增加
Access-Control-Allow-Credentials: true。
2.输入url发生了什么
协商缓存第二个重要的字段是,If-Modified-Since,如果客户端发送的If-Modified-Since的值跟服务器端获取的文件最近改动的时间,一致则命中协商缓存,返回304;不一致则返回新的last-modified和文件并返回200;
如果响应中未显示Expires,Cache-Control:max-age或Cache-Control:s-maxage,并且响应中不包含其他有关缓存的限制,缓存可以使用启发式方法计算新鲜度寿命。通常会根据响应头中的2个时间字段 Date 减去 Last-Modified 值的 10% 作为缓存时间。
3. TCP
彻底搞懂TCP协议:从 TCP 三次握手四次挥手说起
4. https
5. http状态码
关于 HTTP 307 状态码
6.Ajax/axios/fetch
7.XSS/CSRF
如何防止CSRF攻击?
Prevent XSS and CSRF attacks on your website
HttpOnly
js不能使用document.cookie
Content-Security-Policy: default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report
X-XSS-Protection: 1; mode=block
8.TCP/UDP
9.http结构
The text was updated successfully, but these errors were encountered: