mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-05 01:38:51 +01:00
Checking ifModifiedSince param
This commit is contained in:
parent
841d8f457f
commit
b8948c417e
5 changed files with 86 additions and 20 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"net/http"
|
||||
"net/http/httptest"
|
||||
_ "github.com/deluan/gosonic/conf"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -15,8 +16,12 @@ const (
|
|||
testVersion = "1.0.0"
|
||||
)
|
||||
|
||||
func AddParams(url string) string {
|
||||
return fmt.Sprintf("%s?u=%s&p=%s&c=%s&v=%s", url, testUser, testPassword, testClient, testVersion)
|
||||
func AddParams(endpoint string, params ...string) string {
|
||||
url := fmt.Sprintf("%s?u=%s&p=%s&c=%s&v=%s", endpoint, testUser, testPassword, testClient, testVersion)
|
||||
if len(params) > 0 {
|
||||
url = url + "&" + strings.Join(params, "&")
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
func Get(url string, testCase string) (*http.Request, *httptest.ResponseRecorder) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue