aboutsummaryrefslogtreecommitdiff
path: root/pkg/twilio/util.go
blob: 1f1d2696e822bef5991fe97f22f17a283cbcfe10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-FileCopyrightText: © 2021 Grégoire Duchêne <gduchene@awhk.org>
// SPDX-License-Identifier: ISC

package twilio

import (
	"fmt"
	"net/http"
)

// EmptyResponseHandler writes an empty XML response so Twilio knows not
// to do anything after a webhook has been called.
var EmptyResponseHandler = http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
	w.Header().Set("Content-Type", "text/xml")
	fmt.Fprint(w, "<Response/>")
})