Skip to content

Commit

Permalink
Add text property to bunny.net response
Browse files Browse the repository at this point in the history
  • Loading branch information
fileformat committed Nov 8, 2024
1 parent 59bfa1c commit cba7be9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bunny.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type bunnyApiResponse struct {
Country string `json:"country"`
State string `json:"state"`
ServerZone string `json:"serverzone"`
Text string `json:"text"`
Raw map[string]string `json:"raw"`
}

Expand All @@ -85,6 +86,7 @@ func bunnyApiHandler(w http.ResponseWriter, r *http.Request) {
result.Country = getHeader(r, "Cdn-Requestcountrycode", "(not set)")
result.State = getHeader(r, "Cdn-Requeststatecode", "(not set)")
result.ServerZone = getHeader(r, "Cdn-Serverzone", "(not set)")
result.Text = fmt.Sprintf("%s, %s", result.State, result.Country)

write_with_callback(w, r, result)
}

0 comments on commit cba7be9

Please sign in to comment.