progress
This commit is contained in:
6
main.go
6
main.go
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/emersion/go-webdav/caldav"
|
||||
@@ -27,6 +28,11 @@ func main() {
|
||||
handler := &caldav.Handler{Backend: be}
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasPrefix(r.URL.Path, "/public/") {
|
||||
be.ServePublicICS(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
user, password, ok := r.BasicAuth()
|
||||
if !ok {
|
||||
w.Header().Set("WWW-Authenticate", `Basic realm="CalDAV Server"`)
|
||||
|
||||
Reference in New Issue
Block a user