mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-21 22:56:29 -04:00
Allow clientId to be specified in query params
This commit is contained in:
@@ -217,9 +217,12 @@ func (h *shandler) GetAudioSegment(c echo.Context) error {
|
||||
}
|
||||
|
||||
func getClientId(c echo.Context) (string, error) {
|
||||
key := c.Request().Header.Get("X-CLIENT-ID")
|
||||
key := c.QueryParam("clientId")
|
||||
if key == "" {
|
||||
return "", echo.NewHTTPError(http.StatusBadRequest, "missing client id. Please specify the X-CLIENT-ID header to a guid constant for the lifetime of the player (but unique per instance)")
|
||||
key = c.Request().Header.Get("X-CLIENT-ID")
|
||||
}
|
||||
if key == "" {
|
||||
return "", echo.NewHTTPError(http.StatusBadRequest, "missing client id. Please specify the X-CLIENT-ID header (or the clientId query param) to a guid constant for the lifetime of the player (but unique per instance)")
|
||||
}
|
||||
return key, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user