fix: 🔥 Really fix the base url issue this time

pull/4356/head
tidusjar 3 years ago
parent e9cc8b6fe7
commit 9f36923c51

@ -269,10 +269,10 @@ namespace Ombi
var indexHtml = await File.ReadAllTextAsync(indexPath);
var sb = new StringBuilder(indexHtml);
var headPosition = indexHtml.IndexOf("<head>");
var firstLinkPosition = indexHtml.IndexOf("<link");
var headPosition = indexHtml.IndexOf("<script");
var firstLinkPosition = indexHtml.IndexOf("<style type=");
sb.Remove(headPosition + 6, firstLinkPosition - headPosition - 6);
sb.Remove(headPosition, firstLinkPosition - headPosition - 6);
sb.Insert(headPosition + 6,
$"<script type='text/javascript'>window[\"baseHref\"] = '{trimmedBaseUrl}';</script><base href=\"{trimmedBaseUrl}/\">");

Loading…
Cancel
Save