Skip to content

"websites add-content" server response contains a content-type error. #2033

@wh0amitz

Description

@wh0amitz

Describe the bug

When I create a website and recursively add the entire directory as content, the content-type of static files such as JS and CSS in the web server response is incorrect.

To Reproduce
When I create a website using the following command and recursively add the entire directory as content, the content-type of static files such as JS and CSS in the web server response is incorrect.

websites add-content --website portal-site --web-path / --content ./portal-site --recursive
Image

This will cause the websites to fail to display the desired page layout:

Image

The main file that affects the front-end rendering is /css/style.css.

Under normal circumstances, the content-type of these two types of files in a web response should be:

  • css: "text/css; charset=utf-8"
  • js: "text/javascript; charset=utf-8"

After I modified the content-type of /css/style.css using the following command, the front-end display worked correctly:

websites add-content --website portal-site --web-path /css/style.css --content ./portal-site/css/style.css --content-type "text/css; charset=utf-8"

However, sometimes I have many static CSS files, and I can't possibly modify their content-type one by one. So, could you please help me fix this?

Thank you!

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