Compare commits

...

3 Commits

Author SHA1 Message Date
mrasong
1cfd91cf21
Merge 4991596daea57d78dbc0320a6ac708f7dc288021 into f7efbfeec53b64b85b256124b896430289933757 2024-01-16 06:46:37 -08:00
Remember
f7efbfeec5
fix: typo (#3938) 2024-01-16 18:38:54 +08:00
mrasong
4991596dae fixed: API error when the proxy name contains "#". 2023-12-15 17:50:23 +08:00
3 changed files with 5 additions and 4 deletions

View File

@ -129,7 +129,7 @@ allowPorts = [
maxPortsPerClient = 0
# If subDomainHost is not empty, you can set subdomain when type is http or https in frpc's configure file
# When subdomain is est, the host used by routing is test.frps.com
# When subdomain is test, the host used by routing is test.frps.com
subDomainHost = "frps.com"
# custom 404 page for HTTP requests

View File

@ -17,6 +17,7 @@ package server
import (
"encoding/json"
"net/http"
"net/url"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
@ -282,7 +283,7 @@ func (svr *Service) apiProxyByTypeAndName(w http.ResponseWriter, r *http.Request
res := GeneralResponse{Code: 200}
params := mux.Vars(r)
proxyType := params["type"]
name := params["name"]
name, _ := url.QueryUnescape(params["name"])
defer func() {
log.Info("Http response [%s]: code [%d]", r.URL.Path, res.Code)
@ -350,7 +351,7 @@ type GetProxyTrafficResp struct {
func (svr *Service) apiProxyTraffic(w http.ResponseWriter, r *http.Request) {
res := GeneralResponse{Code: 200}
params := mux.Vars(r)
name := params["name"]
name, _ := url.QueryUnescape(params["name"])
defer func() {
log.Info("Http response [%s]: code [%d]", r.URL.Path, res.Code)

View File

@ -11,7 +11,7 @@ const props = defineProps<{
}>()
const fetchData = () => {
let url = '../api/traffic/' + props.proxyName
let url = '../api/traffic/' + encodeURIComponent(props.proxyName)
fetch(url, { credentials: 'include' })
.then((res) => {
return res.json()