mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-24 19:09:47 +01:00
refactor(plugins): enhance user authorization handling and streamline form data processing
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
b1a51f9bbe
commit
425fe862ba
4 changed files with 62 additions and 63 deletions
|
|
@ -86,11 +86,8 @@ func (s *subsonicAPIServiceImpl) executeRequest(ctx context.Context, uri string,
|
|||
RawQuery: query.Encode(),
|
||||
}
|
||||
|
||||
// Create HTTP request with a fresh context to avoid Chi RouteContext pollution.
|
||||
// Using http.NewRequest (instead of http.NewRequestWithContext) ensures the internal
|
||||
// SubsonicAPI call doesn't inherit routing information from the parent handler,
|
||||
// which would cause Chi to invoke the wrong handler. Authentication context is
|
||||
// explicitly added in the next step via request.WithInternalAuth.
|
||||
// Use http.NewRequest (not WithContext) to avoid inheriting Chi RouteContext;
|
||||
// auth context is set explicitly below via request.WithInternalAuth.
|
||||
httpReq, err := http.NewRequest("GET", finalURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create HTTP request: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue