23233.github.io's Introduction
23233.github.io's People
23233.github.io's Issues
python版本的请求与golang版本的请求差别
对于query的escape处理策略不同
- python 如果使用
urllib.parse.quote
默认会有一个safe 其中对于abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-~/
这些字符默认是不进行转换的. - golang 使用
url.QueryEscape
默认是会把所有的符号和字符都会序列化 因为按照要求http标准的要求是要保证query没有特殊字符的 - 但是这点在进行一些爬虫业务时候特别不友好 其中以
/
被序列化最为致命 所以在golang中可以使用以下方法进行序列化保证与python的一致
func CustomQueryEscape(s string) string {
// 定义不需要转义的字符
safeChars := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-~/"
// 创建一个字符串构建器
var escaped strings.Builder
// 遍历字符串中的每个字符
for _, char := range s {
// 如果字符在 safeChars 中,则直接添加到结果中
if strings.ContainsRune(safeChars, char) {
escaped.WriteRune(char)
} else {
// 否则,使用 url.QueryEscape 对字符进行编码
escaped.WriteString(url.QueryEscape(string(char)))
}
}
return escaped.String()
}
请求的区别
- 如果使用requests 默认就是http1 因为没有http2
- 而golang默认就是http2 自动协商的
再测试一下
测试的内容
nginx proxy manager 也就是npm如何重设密码以及忘了用户名如何找到用户名
本教程仅适用于使用docker部署
重设密码
这里面有两个镜像 一个是官方的 一个是 jlesage
的 对比其中的话 jlesage
有快捷工具
官方镜像使用mysql
docker exec -it nginx-proxy-manager sh
mysql -u root -p
use nginxproxymanager;
UPDATE user SET is_deleted=1;
jlesage的镜像
/opt/nginx-proxy-manager/bin/reset-password [email protected] newpassword
忘记邮箱/用户名
使用mysql
docker exec -it nginx-proxy-manager sh
mysql -u root -p
use nginxproxymanager;
select * from user;
使用sqlite
直接通过docker 把sqlite的db映射出去 然后随便拿一个软件 打开sqlite 就能看到 没加密
测试一下
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.