mirror of
https://github.com/bitwarden/server.git
synced 2025-05-08 05:02:21 -05:00
icon service fixes
This commit is contained in:
parent
5c17f910fe
commit
9561b167f7
@ -139,9 +139,10 @@ namespace Bit.Icons.Services
|
|||||||
foreach(var icon in icons)
|
foreach(var icon in icons)
|
||||||
{
|
{
|
||||||
Uri iconUri = null;
|
Uri iconUri = null;
|
||||||
if(icon.Path.StartsWith("//"))
|
if(icon.Path.StartsWith("//") && Uri.TryCreate($"{GetScheme(uri)}://{icon.Path.Substring(2)}",
|
||||||
|
UriKind.Absolute, out var slashUri))
|
||||||
{
|
{
|
||||||
iconUri = new Uri($"{GetScheme(uri)}://{icon.Path.Substring(2)}");
|
iconUri = slashUri;
|
||||||
}
|
}
|
||||||
else if(Uri.TryCreate(icon.Path, UriKind.Relative, out var relUri))
|
else if(Uri.TryCreate(icon.Path, UriKind.Relative, out var relUri))
|
||||||
{
|
{
|
||||||
@ -281,9 +282,20 @@ namespace Bit.Icons.Services
|
|||||||
|
|
||||||
Uri location = null;
|
Uri location = null;
|
||||||
if(response.Headers.Location.IsAbsoluteUri)
|
if(response.Headers.Location.IsAbsoluteUri)
|
||||||
|
{
|
||||||
|
if(response.Headers.Location.Scheme != "http" && response.Headers.Location.Scheme != "https")
|
||||||
|
{
|
||||||
|
if(Uri.TryCreate($"https://{response.Headers.Location.OriginalString}",
|
||||||
|
UriKind.Absolute, out var newUri))
|
||||||
|
{
|
||||||
|
location = newUri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
location = response.Headers.Location;
|
location = response.Headers.Location;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var requestUri = response.RequestMessage.RequestUri;
|
var requestUri = response.RequestMessage.RequestUri;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user