Skip to content

Markdown preview doesn't work #1409

Closed
Closed

Description

@nhooyr

Activity

  1. nhooyr commented on Mar 11, 2020

    @nhooyr
    ContributorAuthor

    Seems to be an iframe issue #296 (comment)

    Maybe related to #1401

  2. ViRb3 commented on Mar 12, 2020

    @ViRb3

    Apologies, the problem was in an inherited nginx config:

    # XSS
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    Everything works after I cleared those headers. Feel free to close this issue.

  3. nhooyr commented on Mar 12, 2020

    @nhooyr
    ContributorAuthor

    Glad you figured it out.

  4. jgsun commented on Sep 12, 2021

    @jgsun

    Apologies, the problem was in an inherited nginx config:

    # XSS
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    Everything works after I cleared those headers. Feel free to close this issue.

    I am wondering how to or where to clear those headers? Thanks you very mucy!

  5. miramar-labs commented on Apr 8, 2022

    @miramar-labs

    It's still happening in the latest builds - any chance you could elaborate on the 'fix' mentioned above ?

  6. ViRb3 commented on Apr 8, 2022

    @ViRb3

    I have a global nginx config called tls.conf which sets the following "security" headers:

    # XSS
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";

    These cause requests to be blocked by the browser while using code-server, resulting in the issue here. To fix it, simply don't set or clear the three headers mentioned above. For example:

    server {
        server_name foo.bar;
    
        location / {
            # override from tls.conf
            # required for Markdown preview
            add_header X-Frame-Options "";
            add_header X-Content-Type-Options "";
            add_header X-XSS-Protection "";
    
            proxy_pass http://code-server:8080;
        }
    
        listen 443 ssl http2;
        include presets/tls.conf;
    }

    Hope this makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions