vendoring and caldav

This commit is contained in:
Vincent Batts 2018-04-01 11:08:20 -04:00
parent a06aa900b7
commit fd9092e5ab
96 changed files with 14832 additions and 5 deletions

22
vendor/github.com/samedi/caldav-go/handlers/shared.go generated vendored Normal file
View file

@ -0,0 +1,22 @@
package handlers
import (
"net/http"
"io/ioutil"
"bytes"
"github.com/samedi/caldav-go/lib"
)
// Supported ICal components on this server.
var supportedComponents = []string{lib.VCALENDAR, lib.VEVENT}
// This function reads the request body and restore its content, so that
// the request body can be read a second time.
func readRequestBody(request *http.Request) string {
// Read the content
body, _ := ioutil.ReadAll(request.Body)
// Restore the io.ReadCloser to its original state
request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
// Use the content
return string(body)
}