Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider stripping https://login.microsoft.com from templates resource urls #1

Open
KevinCathcart opened this issue Mar 26, 2021 · 0 comments

Comments

@KevinCathcart
Copy link

I think the result (local resources use domain relative paths like "/templates/src/..." is probably more useful than having absolute urls that point at "https://login.microsoft.com/template/src" and don't resolve.

Alternatively, use an absolute url that is clearly a placeholder, like https://localhost/ or https://static.contoso.com/.

The following trivial patch, and rerunning would handle this.

                     // Change the directory name for the legacy template
                     if (htmlFileURI.IndexOf("templates/") < 0)
                     {
                         reply = reply.Replace("https://login.microsoftonline.com/static/tenant/default/img/",
                                       "https://login.microsoftonline.com/static/tenant/templates/classic/img/");
                     }
                     
+                    // Use domain relative urls.
+                    reply = reply.Replace("https://login.microsoftonline.com/", "/");
+
                     // Remove the static tenant
                     reply = reply.Replace("/static/tenant/", "/");
 
                     // Add the src folder to the path
                     reply = reply.Replace("/templates/", "/templates/src/");
 
                     File.WriteAllText(localpath, reply);

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant