mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
ApiKey Authentication cleanup
This commit is contained in:
parent
57fdbe6e08
commit
de607e207b
8 changed files with 48 additions and 45 deletions
|
@ -38,21 +38,7 @@ namespace NzbDrone.Api.Frontend.Mappers
|
|||
|
||||
public override Response GetResponse(string resourceUrl)
|
||||
{
|
||||
string content;
|
||||
var response = base.GetResponse(resourceUrl);
|
||||
var stream = new MemoryStream();
|
||||
|
||||
response.Contents.Invoke(stream);
|
||||
stream.Position = 0;
|
||||
|
||||
using (var reader = new StreamReader(stream))
|
||||
{
|
||||
content = reader.ReadToEnd();
|
||||
}
|
||||
|
||||
content = content.Replace("API_KEY", _configFileProvider.ApiKey);
|
||||
|
||||
response = new StreamResponse(() => StringToStream(content), response.ContentType);
|
||||
response.Headers["X-UA-Compatible"] = "IE=edge";
|
||||
|
||||
return response;
|
||||
|
@ -70,6 +56,7 @@ namespace NzbDrone.Api.Frontend.Mappers
|
|||
|
||||
text = text.Replace(".css", ".css?v=" + BuildInfo.Version);
|
||||
text = text.Replace(".js", ".js?v=" + BuildInfo.Version);
|
||||
text = text.Replace("API_KEY", _configFileProvider.ApiKey);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue