fastdlabs / http Goto Github PK
View Code? Open in Web Editor NEWSupport Swoole Implement PSR7
License: MIT License
Support Swoole Implement PSR7
License: MIT License
http/src/SwooleServerRequest.php
Line 67 in 10825d8
将请求头中的 - 替换成 _ 有点多余,且不符合标准。
f16ea97
如果转发多次 有, 的情况下 会报错。
reset 已经不支持 入参为函数返回
如题。
优先取 SERVER_NAME
可能有什么问题?
比如 nginx 中设置站点为:
server_name ~^(?<subdomain>.+).yourname.com$;
那么拼接的 URI 可能是这样的:
http://~^(?<subdomain>.+).yourname.com$/abc
,这样的 URI 不能被正确路由。
更多关于 SERVER_NAME
和 HTTP_HOST
区别:
https://stackoverflow.com/questions/2297403/what-is-the-difference-between-http-host-and-server-name-in-php
https://github.com/JanHuang/http/blob/a1a3f0a6629f8972308bb27b2b00f44fdfe727cc/src/Response.php#L428
这里加上 Cache-Control: max-age=<seconds>
会好一些。原因:
Expires
的话,可能存在客户端和服务端时间不一致,导致缓存失效的情况。Cache-Control
header 存在 "max-age" 或 "s-max-age" 指令时,Expires
头部会被忽略。Cache-Control
出来的目的,就是取代 Expires
的。Expires
是从 HTTP 1.0 开始定义的,使用它更多是在兼容性方面考虑。A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.