Permalink
Browse files

Fix url

  • Loading branch information...
rosylilly committed Oct 31, 2015
1 parent 8417f68 commit b328fc36fac43445a28d6ab4a190a3138be5ff73
Showing with 7 additions and 3 deletions.
  1. +7 −3 5f/webapp/golang/proxy.go
View
@@ -19,8 +19,8 @@ const (
var (
ENDPOINTS = map[string]string{
- "/tokens": "https://api.five-final.isucon.net:8443/tokens",
- "/attacked_list": "https://api.five-final.isucon.net:8443/attacked_list",
+ "/tokens": "api.five-final.isucon.net:8443",
+ "/attacked_list": "api.five-final.isucon.net:8443",
}
)
@@ -100,8 +100,12 @@ func main() {
func getResponse(req *http.Request) (*http.Request, *http.Response) {
endpoint := ENDPOINTS[req.URL.Path]
+ req.URL.Host = endpoint
+ req.URL.Scheme = "https"
+ fmt.Printf("%s\n", req.URL.String())
+ fmt.Printf("%s\n", req.Header.Get("X-Perfect-Security-Token"))
- nreq, err := http.NewRequest("GET", endpoint, nil)
+ nreq, err := http.NewRequest("GET", req.URL.String(), nil)
if err != nil {
log.Printf("%s", err)
return nreq, nil

0 comments on commit b328fc3

Please sign in to comment.