https://github.com/noear/jlhttp
jlhttp
https://github.com/noear/jlhttp
Last synced: 4 months ago
JSON representation
jlhttp
- Host: GitHub
- URL: https://github.com/noear/jlhttp
- Owner: noear
- License: gpl-2.0
- Created: 2024-03-02T00:43:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-27T05:28:20.000Z (over 1 year ago)
- Last Synced: 2024-12-30T18:38:34.672Z (over 1 year ago)
- Language: Java
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
修改记录:
* 1389行修改:
添加:getOriginalUri();解决getUri(),无法拿到域和端口问题
* 1366 + 2111行修改:
获取:socket 的址址,作为:remoteAddr(否则没有远程连接地址)
* 1491行修改:
添加_paramsList,实现参数寄存功能(流只能读一次,后面就没了)
* 1748行修改:(优先使用传进来的contentType,解决内部404之类的调用无法显示为html的问题 )
* 2807行修改:
将编译改为:UTF-8;解决中文参数乱码问题
* 2816行修改:
Headers 构建用 add 替代 rep(支持多值)
```java
public void sendHeaders(int status, long length, long lastModified, String etag, String contentType, long[] range) throws IOException {
String ct = headers.get("Content-Type");
if (ct == null) {
ct = contentType != null ? contentType : "application/octet-stream";
headers.add("Content-Type", ct);
} else {
if (contentType != null) { //noear,20181220
ct = contentType;
}
headers.replace("Content-Type", ct);
}
}
```