- Timestamp:
- Nov 28, 2016, 8:34:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/morty.go
r46 r47 203 203 req.SetConnectionClose() 204 204 205 reqQuery := parsedURI.Query() 206 ctx.QueryArgs().VisitAll(func(key, value []byte) { 207 reqQuery.Add(string(key), string(value)) 208 }) 209 210 parsedURI.RawQuery = reqQuery.Encode() 211 212 uriStr := parsedURI.String() 213 214 log.Println("getting", uriStr) 215 216 req.SetRequestURI(uriStr) 205 requestURIStr := string(requestURI) 206 207 log.Println("getting", requestURIStr) 208 209 req.SetRequestURI(requestURIStr) 217 210 req.Header.SetUserAgentBytes([]byte("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36")) 218 211 … … 253 246 } 254 247 } 255 error_message := fmt.Sprintf("invalid response: %d ", resp.StatusCode())248 error_message := fmt.Sprintf("invalid response: %d (%s)", resp.StatusCode(), requestURIStr) 256 249 p.serveMainPage(ctx, resp.StatusCode(), errors.New(error_message)) 257 250 return … … 652 645 return fmt.Sprintf("./?mortyurl=%s", url.QueryEscape(uri)), nil 653 646 } 647 654 648 return fmt.Sprintf("./?mortyhash=%s&mortyurl=%s", hash(uri, rc.Key), url.QueryEscape(uri)), nil 655 649 }
Note:
See TracChangeset
for help on using the changeset viewer.