Skip to content

Commit cba7be9

Browse files
committed
Add text property to bunny.net response
1 parent 59bfa1c commit cba7be9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bunny.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type bunnyApiResponse struct {
7171
Country string `json:"country"`
7272
State string `json:"state"`
7373
ServerZone string `json:"serverzone"`
74+
Text string `json:"text"`
7475
Raw map[string]string `json:"raw"`
7576
}
7677

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

8991
write_with_callback(w, r, result)
9092
}

0 commit comments

Comments
 (0)