// displayLocation will modify the response to a display location instead of redirecting
displayLocation will modify the response to a display location instead of redirecting
// displayLocation will modify the response to a display location instead of redirecting
func displayLocation(r *http.Response, location string) {
	body, err := json.Marshal(map[string]string{"location": location})
	if err != nil {
		panic("Cannot display the location.")
	}
	r.Body = ioutil.NopCloser(bytes.NewReader(body))
	r.ContentLength = int64(len(body))
	r.StatusCode = http.StatusOK
	r.Header = http.Header{}
	r.Header.Set("Content-Type", "application/json")
	r.Header.Set("Content-Length", strconv.Itoa(len(body)))
}
func displayLocation ( r * http . Response , location string ) { body , err := json . Marshal ( map [ string ] string { " " : location } ) if err != nil { panic ( " " ) } r . Body = ioutil . NopCloser ( bytes . NewReader ( body ) ) r . ContentLength = int64 ( len ( body ) ) r . StatusCode = http . StatusOK r . Header = http . Header { } r . Header . Set ( " " , " " ) r . Header . Set ( " " , strconv . Itoa ( len ( body ) ) ) }
displayLocation will modify the response to a display location instead of redirecting
displayLocation will modify the response to a display location instead of redirecting