Skip to content

Commit fcd2a71

Browse files
committed
Revert "Apply suggestion from @coderabbitai[bot]"
This reverts commit c96ff95.
1 parent c96ff95 commit fcd2a71

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

external/qobuz/bundle.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ type bundle struct {
5454
func fetchBundle(ctx context.Context) (*bundle, error) {
5555
client := &http.Client{Timeout: 30 * time.Second}
5656

57-
req, err := http.NewRequestWithContext(ctx, http.MethodGet, bundleBaseURL+"/login", nil)
58-
if err != nil {
59-
return nil, fmt.Errorf("qobuz: build login request: %w", err)
60-
}
61-
resp, err := client.Do(req)
62-
if err != nil {
6357
req, err := http.NewRequestWithContext(ctx, http.MethodGet, bundleBaseURL+"/login", nil)
6458
if err != nil {
6559
return nil, fmt.Errorf("qobuz: build login request: %w", err)
@@ -69,6 +63,9 @@ func fetchBundle(ctx context.Context) (*bundle, error) {
6963
return nil, fmt.Errorf("qobuz: get login page: %w", err)
7064
}
7165
defer resp.Body.Close()
66+
if resp.StatusCode != http.StatusOK {
67+
return nil, fmt.Errorf("qobuz: get login page: HTTP %s", resp.Status)
68+
}
7269
page, err := io.ReadAll(resp.Body)
7370
if err != nil {
7471
return nil, fmt.Errorf("qobuz: read login page: %w", err)
@@ -89,6 +86,9 @@ func fetchBundle(ctx context.Context) (*bundle, error) {
8986
return nil, fmt.Errorf("qobuz: get bundle.js: %w", err)
9087
}
9188
defer resp2.Body.Close()
89+
if resp2.StatusCode != http.StatusOK {
90+
return nil, fmt.Errorf("qobuz: get bundle.js: HTTP %s", resp2.Status)
91+
}
9292
body, err := io.ReadAll(resp2.Body)
9393
if err != nil {
9494
return nil, fmt.Errorf("qobuz: read bundle.js: %w", err)

0 commit comments

Comments
 (0)