Compare commits

..

No commits in common. "4ef5b7b2dd5a5033f7224a9ead9cab66ce3bc48f" and "071bf66721c4c4f6649f6149a6a55624d4461a20" have entirely different histories.

3 changed files with 6 additions and 14 deletions

View File

@ -154,23 +154,16 @@ func (handler *subscriptionHandler) handleSubscription(w http.ResponseWriter, r
callbackURL, err := url.Parse(callback)
if callback == "" || err != nil {
http.Error(w, "cannot parse callback url", 400)
log.Printf("cannot parse callback url: %s", callback)
http.Error(w, "Can not parse callback url", 400)
log.Printf("Can not parse callback url: %s\n", callback)
return err
}
if !callbackURL.IsAbs() {
http.Error(w, "callback url is not absolute", 400)
return fmt.Errorf("callback url is not absolute: %s", callback)
}
topicURL, err := url.Parse(topic)
if topic == "" || err != nil {
http.Error(w, "cannot parse topic url", 400)
return fmt.Errorf("cannot parse topic url: %s\n", topic)
}
if !topicURL.IsAbs() {
http.Error(w, "topic url is not absolute", 400)
return fmt.Errorf("topic url is not absolute: %s", topic)
http.Error(w, "Can't parse topic url", 400)
log.Printf("Can't parse topic url: %s\n", topic)
return err
}
log.Println("subscribe: sending 202 header request accepted")

View File

@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS "subscribers"
create table "subscribers"
(
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
topic varchar(255) not null,

View File

@ -1 +0,0 @@
CREATE UNIQUE INDEX IF NOT EXISTS "subscribers_topic_callback" ON "subscribers" ("topic", "callback");