mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-25 07:46:49 +09:00
Migrate platform config out of Gin
This commit is contained in:
1 parent
6c9c9a401f
commit
e611063669
1 file changed
+11
-1
+11
-1
@@ -7,6 +7,7 @@ import (
|
|||||||
textTemplate "text/template"
|
textTemplate "text/template"
|
||||||
|
|
||||||
"github.com/gofrs/uuid"
|
"github.com/gofrs/uuid"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -188,7 +189,16 @@ func (h *Headscale) ApplePlatformConfig(
|
|||||||
w http.ResponseWriter,
|
w http.ResponseWriter,
|
||||||
r *http.Request,
|
r *http.Request,
|
||||||
) {
|
) {
|
||||||
platform := r.URL.Query().Get("platform")
|
vars := mux.Vars(r)
|
||||||
|
platform, ok := vars["platform"]
|
||||||
|
if !ok {
|
||||||
|
log.Error().
|
||||||
|
Str("handler", "ApplePlatformConfig").
|
||||||
|
Msg("No platform specified")
|
||||||
|
http.Error(w, "No platform specified", http.StatusBadRequest)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
id, err := uuid.NewV4()
|
id, err := uuid.NewV4()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user