This media is not supported in your browser
VIEW IN TELEGRAM
新栏目,尽量每天发点 #今天看了啥 ,以使频道名副其实——是 Note。
http encoding:
https://httptoolkit.com/blog/http-encodings/ (blog, en)
> 离谱,竟然会有服务端的 content-encoding 返回 amz-1.0, json, utf-8, text, binary 之类的内容。
html encoding:
https://encoding.spec.whatwg.org (spec, en)
→ https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding (spec, en)
→ https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-charset (spec, en)
https://en.wikipedia.org/wiki/Windows-1252 (wiki, en)
> websites declared ISO 8859-1 which is treated as Windows-1252 by all modern browsers (as required by the HTML5 standard)
→ https://w3techs.com/technologies/overview/character_encoding (各 html 编码的使用率,也有分语言的统计)
https://www.xiaogd.net/md/web-page-encoding-and-mojibake-1 (blog, zh)
repo:
https://github.com/edsrzf/mmap-go
https://github.com/long2ice/meilisync
有意思的代码:
https://cs.opensource.google/go/go/+/refs/tags/go1.24.2:src/unicode/utf8/utf8.go;drc=3d33437c450aa74014ea1d41cd986b6ee6266984;l=444
http encoding:
https://httptoolkit.com/blog/http-encodings/ (blog, en)
> 离谱,竟然会有服务端的 content-encoding 返回 amz-1.0, json, utf-8, text, binary 之类的内容。
html encoding:
https://encoding.spec.whatwg.org (spec, en)
→ https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding (spec, en)
→ https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-charset (spec, en)
https://en.wikipedia.org/wiki/Windows-1252 (wiki, en)
> websites declared ISO 8859-1 which is treated as Windows-1252 by all modern browsers (as required by the HTML5 standard)
→ https://w3techs.com/technologies/overview/character_encoding (各 html 编码的使用率,也有分语言的统计)
https://www.xiaogd.net/md/web-page-encoding-and-mojibake-1 (blog, zh)
repo:
https://github.com/edsrzf/mmap-go
https://github.com/long2ice/meilisync
有意思的代码:
https://cs.opensource.google/go/go/+/refs/tags/go1.24.2:src/unicode/utf8/utf8.go;drc=3d33437c450aa74014ea1d41cd986b6ee6266984;l=444
Httptoolkit
Encoding your HTTP for fun and profit
HTTP content encoding is an incredibly powerful tool that can save you huge amounts of bandwidth and make your web or mobile application faster, basically for...
买全新服务器,预算2w~4w,走报销。要求国内品牌。
懂行的可以推荐些型号吗?
要是我自己买肯定就是捡垃圾了,但是是学校买,说二手不好走账,非得国产+全新。
看了眼,全新的价格都很坑爹。
用于虚拟化开小鸡。
懂行的可以推荐些型号吗?
要是我自己买肯定就是捡垃圾了,但是是学校买,说二手不好走账,非得国产+全新。
看了眼,全新的价格都很坑爹。
用于虚拟化开小鸡。
🤩2
yzqzss|一座桥在水上's Note
买全新服务器,预算2w~4w,走报销。要求国内品牌。 懂行的可以推荐些型号吗? 要是我自己买肯定就是捡垃圾了,但是是学校买,说二手不好走账,非得国产+全新。 看了眼,全新的价格都很坑爹。 用于虚拟化开小鸡。
离谱的是,明明机房里有台只插了一根内存条的 r730 吃灰,只要再花不到1k块钱买一吨内存条+还掉两个cpu就能满血复活。但是说不好走账报销。
今天看了啥:
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#resolving-urls
Let encoding be UTF-8.
If environment is a Document object, then set [encoding] (document charset) to environment's character encoding.
https://url.spec.whatwg.org/#query-state
2. Percent-encode after encoding, with [encoding], buffer, and queryPercentEncodeSet, and append the result to url’s query.
https://url.spec.whatwg.org/#path-state
1. ...special cases...
2. Otherwise, run these steps:
.... special cases ...
3. UTF-8 percent-encode c using the path percent-encode set and append the result to buffer.
好 TM 抽象啊,web 就是一坨屎山。
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#resolving-urls
Let encoding be UTF-8.
If environment is a Document object, then set [encoding] (document charset) to environment's character encoding.
https://url.spec.whatwg.org/#query-state
2. Percent-encode after encoding, with [encoding], buffer, and queryPercentEncodeSet, and append the result to url’s query.
https://url.spec.whatwg.org/#path-state
1. ...special cases...
2. Otherwise, run these steps:
.... special cases ...
3. UTF-8 percent-encode c using the path percent-encode set and append the result to buffer.
好 TM 抽象啊,web 就是一坨屎山。
😐3
Forwarded from 囍频道 (IceCode New)
https://github.com/IceCodeNew/anata-no-minato
在那之后 @yzqzss 开发了一个 Python 脚本用于自动从 ~/.ssh/config 转换出 hosts.csv 配置
我非常欣赏这个脚本,征求过同意以后把这段脚本集成到了我的项目里。感谢他给我的启发(和借我抄的作业)
现在你可以在 https://github.com/IceCodeNew/anata-no-minato 上看到我新开的 bug 全家桶啦~
新的镜像只需要挂载
在那之后 @yzqzss 开发了一个 Python 脚本用于自动从 ~/.ssh/config 转换出 hosts.csv 配置
我非常欣赏这个脚本,征求过同意以后把这段脚本集成到了我的项目里。感谢他给我的启发(和借我抄的作业)
现在你可以在 https://github.com/IceCodeNew/anata-no-minato 上看到我新开的 bug 全家桶啦~
新的镜像只需要挂载
${HOME}/.ssh/
目录就可以食用了。但是仍然推荐参考 README.md 下方的说明,生成 ananta 函数并写入 ~/.bashrc 文件,这样日后使用只要简单执行 ananta whoami
即可GitHub
GitHub - IceCodeNew/anata-no-minato
Contribute to IceCodeNew/anata-no-minato development by creating an account on GitHub.
🤩3
笑死了,碰到一个 ctf 系统:
- 把选择题答案明晃晃放前端 html 里。
- 一个队里的不同用户可分别提交同一个题,共同计分。
- API 没有用户鉴权,提交只需要 user_id 和 team_id 。可当全员好人,帮别人提交。
相关域名: bestctf.com
- 把选择题答案明晃晃放前端 html 里。
- 一个队里的不同用户可分别提交同一个题,共同计分。
- API 没有用户鉴权,提交只需要 user_id 和 team_id 。可当全员好人,帮别人提交。
相关域名: bestctf.com
🤣2
yzqzss|一座桥在水上's Note
今天看了啥: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#resolving-urls Let encoding be UTF-8. If environment is a Document object, then set [encoding] (document charset) to environment's character encoding. https://url.spec.whatwg.org/#query…
又是被 URL 创的一天:我还在被 url 折磨……
1.
空格的 escape 规则是脑溢血, path 部分必须用 %20,path 中的 + 就表示加号本身;query 部分可以用 %20 或 + ,加号本身反而需要转义。(为什么呢?因为历史遗留问题,我甚至也没找到 + 的标准在哪儿定义的,RFC 3986 里真没写 + 可以用于转义空格)
https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
现代浏览器使用 %20。但是各种语言的库出于兼容性仍然使用 + 来 escape 空格。
但是但是,在非 web 的世界里,大家又遵守标准的 URI 规范了……如 mailto 中:
2.
由于 / 可被 escape 成 %2F ,而 url path resolve 标准化 (处理 path 中的 ../ 和 ./) 过程只对 / 字面量生效 (resolve 发生在 url unescape 之前)
而经过 unescape 后,%2F 和真正的 / 都被 unescape 成了 /,这时候 url 的 path 就不是它真正的 path 了。
所以需要保留原始的 path 用于正确处理 url join ,而不是用解码后的 path。
我感觉这里会有好玩的事情发生。
如果一些 http web 框架/反向代理/WAF/CDN 的机制不一致,比如一个是用 resolve+unescape 后的 path 来路由,一个使用 resolve 了但没有 unescape 的 path 来路由,一个使用原始的 path 来路由。
嘿嘿嘿/
3.
url path 中如果出现非有效 hex 的百分号编码(比如 %ZZ),基本上各种 http server 会无条件拒绝,返回 400 ,有些则是直接断连接。
但是,如果 query 中出现了非有效的 hex,大家的选择是丢掉坏掉的那一项 query kv pair。
1.
空格的 escape 规则是脑溢血, path 部分必须用 %20,path 中的 + 就表示加号本身;query 部分可以用 %20 或 + ,加号本身反而需要转义。(为什么呢?因为历史遗留问题,我甚至也没找到 + 的标准在哪儿定义的,RFC 3986 里真没写 + 可以用于转义空格)
https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
(for backwards compatibility: do not try to search for it in the URI standard)
现代浏览器使用 %20。但是各种语言的库出于兼容性仍然使用 + 来 escape 空格。
但是但是,在非 web 的世界里,大家又遵守标准的 URI 规范了……如 mailto 中:
Note that for email links, you do need %20 and not + after the ?. For example, mailto:support@example.org?subject=I%20need%20help. If you tried that with +, the email will open with +es instead of spaces.
2.
由于 / 可被 escape 成 %2F ,而 url path resolve 标准化 (处理 path 中的 ../ 和 ./) 过程只对 / 字面量生效 (resolve 发生在 url unescape 之前)
而经过 unescape 后,%2F 和真正的 / 都被 unescape 成了 /,这时候 url 的 path 就不是它真正的 path 了。
所以需要保留原始的 path 用于正确处理 url join ,而不是用解码后的 path。
我感觉这里会有好玩的事情发生。
如果一些 http web 框架/反向代理/WAF/CDN 的机制不一致,比如一个是用 resolve+unescape 后的 path 来路由,一个使用 resolve 了但没有 unescape 的 path 来路由,一个使用原始的 path 来路由。
嘿嘿嘿/
3.
url path 中如果出现非有效 hex 的百分号编码(比如 %ZZ),基本上各种 http server 会无条件拒绝,返回 400 ,有些则是直接断连接。
但是,如果 query 中出现了非有效的 hex,大家的选择是丢掉坏掉的那一项 query kv pair。
Stack Overflow
URL encoding the space character: + or %20?
When is a space in a URL encoded to +, and when is it encoded to %20?