2024-01-13 17:14:16 +00:00
|
|
|
//go:build go1.21
|
|
|
|
|
2019-09-14 19:03:48 +00:00
|
|
|
package dlna
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/anacrolix/dms/upnp"
|
|
|
|
)
|
|
|
|
|
|
|
|
type mediaReceiverRegistrarService struct {
|
|
|
|
*server
|
|
|
|
upnp.Eventing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (mrrs *mediaReceiverRegistrarService) Handle(action string, argsXML []byte, r *http.Request) (map[string]string, error) {
|
|
|
|
switch action {
|
|
|
|
case "IsAuthorized", "IsValidated":
|
|
|
|
return map[string]string{
|
|
|
|
"Result": "1",
|
|
|
|
}, nil
|
|
|
|
case "RegisterDevice":
|
|
|
|
return map[string]string{
|
|
|
|
"RegistrationRespMsg": mrrs.RootDeviceUUID,
|
|
|
|
}, nil
|
|
|
|
default:
|
|
|
|
return nil, upnp.InvalidActionError
|
|
|
|
}
|
|
|
|
}
|