mirror of
https://github.com/stashapp/stash.git
synced 2026-02-08 08:21:32 +01:00
fix linter
This commit is contained in:
parent
d3fafb0c4d
commit
82b1dc948e
2 changed files with 6 additions and 6 deletions
|
|
@ -108,21 +108,21 @@ func (r *sceneResolver) Paths(ctx context.Context, obj *models.Scene) (*ScenePat
|
|||
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
|
||||
config := manager.GetInstance().Config
|
||||
builder := urlbuilders.NewSceneURLBuilder(baseURL, obj)
|
||||
|
||||
|
||||
// Use configurable expiry for signed URLs (only for AirPlay-compatible formats)
|
||||
expires := time.Now().Add(time.Duration(config.GetSignedURLExpiry()) * time.Second)
|
||||
|
||||
|
||||
// AirPlay-compatible formats: use signed URLs (streaming + captions)
|
||||
streamPath, err := builder.GetSignedStreamURL(config.GetJWTSignKey(), expires)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
captionBasePath, err := builder.GetSignedCaptionURL(config.GetJWTSignKey(), expires)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
// Web-only formats: use unsigned URLs (rely on cookie authentication)
|
||||
screenshotPath := builder.GetScreenshotURL()
|
||||
previewPath := builder.GetStreamPreviewURL()
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ func VerifyURL(rawURL string, secret []byte) (bool, error) {
|
|||
if len(parts) < 3 || (parts[0] != "scene" && parts[0] != "image" && parts[0] != "gallery") {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
// For scene/image/gallery paths, the base path is /{type}/{id}/{action}
|
||||
basePath := "/" + strings.Join([]string{parts[0], parts[1], parts[2]}, "/")
|
||||
|
||||
|
|
@ -84,4 +84,4 @@ func VerifyURL(rawURL string, secret []byte) (bool, error) {
|
|||
expectedSig := hex.EncodeToString(h.Sum(nil))
|
||||
|
||||
return hmac.Equal([]byte(sig), []byte(expectedSig)), nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue