mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(torznab): Jackett support (#388)
* feat(torznab): add Jackett support * Update torznab.go * fix(feeds): unify jackett and prowlarr apikey
This commit is contained in:
parent
a9fe2cf500
commit
eefd1b576c
2 changed files with 25 additions and 8 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -71,8 +72,14 @@ func TestClient_GetCaps(t *testing.T) {
|
|||
key := "mock-key"
|
||||
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
apiKey := r.Header.Get("X-API-Key")
|
||||
if apiKey != key {
|
||||
//apiKey := r.Header.Get("X-API-Key")
|
||||
//if apiKey != key {
|
||||
// w.WriteHeader(http.StatusUnauthorized)
|
||||
// w.Write(nil)
|
||||
// return
|
||||
//}
|
||||
|
||||
if !strings.Contains(r.RequestURI, key) {
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
w.Write(nil)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue