阅读完这些问答后:
https://stackoverflow.com/questions/43775560/request-sent-by-the-client-is-syntatically-incorrect
https://itecnote.com/tecnote/java-400-bad-request-on-a-post-service/
我已经到了可以猜测客户端或服务器的标头不正确的地步。但我想知道问题出在客户端的请求上还是服务器愿意接受什么?
这里唯一不寻常的是服务器接受的 HEADERS 看起来很麻烦。
content-language: [\r][\n]
除此之外,我在客户端或服务器的标头中找不到任何其他不寻常的东西。
这些是请求标头:
Connection: Keep-Alive[\r][\n]
Host: paytomerchant.example.com[\r][\n]
x-forwarded-prefix: /path/to/example[\r][\n]
x-requested-with: values[\r][\n]
x-real-ip: value[\r][\n]
x-nginx-proxy: true[\r][\n]
x-forwarded-server: traefik-blablablahhh[\r][\n]
x-forwarded-proto: https,http[\r][\n]
x-forwarded-port: 443,80[\r][\n]
x-forwarded-host: hostname1,hostname2
x-forwarded-for: IPV4_1, IPV4_2, IPV4_3[\r][\n]
upgrade-insecure-requests: 1[\r][\n]
sec-fetch-user: ?1[\r][\n]
sec-fetch-site: none[\r][\n]
sec-fetch-mode: navigate[\r][\n]
sec-fetch-dest: document[\r][\n]
accept-language: en,en-US;q=0.9[\r][\n]
accept-encoding: gzip, deflate[\r][\n]
accept: text/html,application/xhtml+xml,app
lication/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9[\r][\n]
user-agent: Mozilla/5.0 (Linux; Android 12;
M2007J20CG Build/SKQ1.211019.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/108.0.5359.128 Mobile Safari/537.36[\r][
\n]
这些是响应标头:
referrer-policy: same-origin[\r][\n]
x-content-type-options: nosniff[\r][\n]
x-xss-protection: 1; mode=block[\r][\n]
x-frame-options: SAMEORIGIN[\r][\n]
content-length: 1105[\r][\n]
date: Sun, 24 Dec 2023 08:00:54 GMT[\r][\n] (Note: The time was 13:43:45 NPT but log showed that)
content-type: text/html[\r][\n]
content-language: [\r][\n]
access-control-expose-headers: Authorizatio
n,auth,Dt,Referer[\r][\n]
access-control-expose-headers: Authorizatio
n,auth,Dt,Referer[\r][\n]
access-control-allow-headers: Content-Type,
Authorization,auth,Dt,Referer[\r][\n]
access-control-allow-methods: GET, POST, DELETE, PUT, OPTIONS[\r][\n]
HTTP/1.1 400 Bad Request[\r][\n]