fix: 微信 JS 安全域名校验文件去掉多余换行
Some checks failed
Build and Deploy Front / deploy (push) Has been cancelled
Some checks failed
Build and Deploy Front / deploy (push) Has been cancelled
确保 MP_verify 与公众平台下载包字节一致,并禁止 SPA 回落与 Git CRLF 改写。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
08cb7bcb37
commit
8c897739a6
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# 微信域名校验文件必须与公众平台下载包字节完全一致(禁止 CRLF / 尾换行)
|
||||
public/MP_verify_*.txt binary
|
||||
@ -420,6 +420,14 @@ server {
|
||||
add_header Expires "0";
|
||||
}
|
||||
|
||||
# 微信 JS 安全域名校验:原样返回 txt,禁止 SPA 回落 index.html
|
||||
location ~* ^/MP_verify_[A-Za-z0-9]+\.txt$ {
|
||||
default_type text/plain;
|
||||
charset off;
|
||||
add_header Cache-Control "no-store";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# ============ 静态资源缓存 ============
|
||||
|
||||
location ~* \.(?:js|css)$ {
|
||||
|
||||
@ -160,6 +160,14 @@ server {
|
||||
add_header Expires "0";
|
||||
}
|
||||
|
||||
# 微信 JS 安全域名校验:原样返回 txt,禁止 SPA 回落 index.html
|
||||
location ~* ^/MP_verify_[A-Za-z0-9]+\.txt$ {
|
||||
default_type text/plain;
|
||||
charset off;
|
||||
add_header Cache-Control "no-store";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ~* \.(?:js|css)$ {
|
||||
try_files $uri =404;
|
||||
expires 1y;
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user