Add query parameters to url
This commit is contained in:
parent
1600b6740c
commit
841d57538f
|
@ -66,9 +66,11 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
|
|
||||||
validationURL := callbackURL
|
validationURL := callbackURL
|
||||||
validationURL.Query().Add("hub.mode", "subscribe")
|
q := validationURL.Query()
|
||||||
validationURL.Query().Add("hub.topic", topicURL.String())
|
q.Add("hub.mode", "subscribe")
|
||||||
validationURL.Query().Add("hub.challenge", RandStringBytes(12))
|
q.Add("hub.topic", topicURL.String())
|
||||||
|
q.Add("hub.challenge", RandStringBytes(12))
|
||||||
|
validationURL.RawQuery = q.Encode()
|
||||||
|
|
||||||
log.Println(validationURL)
|
log.Println(validationURL)
|
||||||
|
|
||||||
|
@ -93,5 +95,5 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.Handle("/", &subscriptionHandler{})
|
http.Handle("/", &subscriptionHandler{})
|
||||||
log.Fatal(http.ListenAndServe(":80", nil))
|
tlog.Fatal(http.ListenAndServe(":80", nil))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user