【BUG】预览反代没有正确处理trailing slash
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/x", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "/x") })
http.HandleFunc("/x/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "/x/") })
http.ListenAndServe(":8080", nil)
}
正确:
错误:
看起来经过一层反代后,trailing slash被丢掉了