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

URL returned by GenerateEditorPageAsync does not honor referrer scheme #1115

Open
8 tasks
dalehhirt opened this issue Feb 22, 2024 · 3 comments
Open
8 tasks
Labels

Comments

@dalehhirt
Copy link
Contributor

Describe the bug

When accessing /editor, the url generated does not honor the https:// scheme. Recommend using an environment variable that can be set if running in a container to https. See line 14 of src\Microsoft.TryDotNet\ContentGenerator.cs

Did this error occur while using dotnet try or online?

  • dotnet-try
  • [ x] online

What kind of error was it?

  • User Interface (UI): For example the output never displayed
  • Service Error: For example "The service is temporarily unavailable. We are working on it"
  • [x ] Other:

app.bundle.js:2 Mixed Content: The page at 'https://.net/editor?enableLogging=true' was loaded over HTTPS, but requested an insecure frame 'http://.net/wasmrunner'. This request has been blocked; the content must be served over HTTPS.

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following:

  • OS
    • [x ] Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • [ x] Chrome
    • [ x] Edge
    • Safari
@dalehhirt
Copy link
Contributor Author

Sample change in ContentGenerator.cs starting at line 14:

        var scheme = Environment.GetEnvironmentVariable("TRY_DOT_NET_REQUEST_SCHEME") ?? request.Scheme;
        var hostUri = new Uri($"{scheme}://{request.Host.Value}", UriKind.Absolute);

@jonsequitur
Copy link
Contributor

Do you plan to PR this?

@dalehhirt
Copy link
Contributor Author

Do you plan to PR this?

I can. Will do that in a few minutes.

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

No branches or pull requests

2 participants