modernize code (#884)

This commit is contained in:
Alessandro Ros
2025-09-07 16:05:13 +02:00
committed by GitHub
parent 9db34842c8
commit 9259df7cff
32 changed files with 296 additions and 432 deletions

View File

@@ -8,10 +8,6 @@ import (
"github.com/bluenviron/gortsplib/v4/pkg/base"
)
func algorithmPtr(v AuthAlgorithm) *AuthAlgorithm {
return &v
}
var casesAuthorization = []struct {
name string
vin base.HeaderValue
@@ -44,7 +40,7 @@ var casesAuthorization = []struct {
Nonce: "dcd98b7102dd2f0e8b11d0f600bfb0c093",
URI: "/dir/index.html",
Response: "e966c932a9242554e42c8ee200cec7f6",
Opaque: stringPtr("5ccc069c403ebaf9f0171e9517f40e41"),
Opaque: ptrOf("5ccc069c403ebaf9f0171e9517f40e41"),
},
},
{
@@ -80,8 +76,8 @@ var casesAuthorization = []struct {
Nonce: "dcd98b7102dd2f0e8b11d0f600bfb0c093",
URI: "/dir/index.html",
Response: "e966c932a9242554e42c8ee200cec7f6",
Opaque: stringPtr("5ccc069c403ebaf9f0171e9517f40e41"),
Algorithm: algorithmPtr(AuthAlgorithmMD5),
Opaque: ptrOf("5ccc069c403ebaf9f0171e9517f40e41"),
Algorithm: ptrOf(AuthAlgorithmMD5),
},
},
{
@@ -99,7 +95,7 @@ var casesAuthorization = []struct {
Nonce: "1ad195c2b2ca5a03784e53f88e16f579",
URI: "rtsp://192.168.80.76/",
Response: "9e2324f104f3ce507d17e44a78fc1293001fe84805bde65d2aaa9be97a5a8913",
Algorithm: algorithmPtr(AuthAlgorithmSHA256),
Algorithm: ptrOf(AuthAlgorithmSHA256),
},
},
}