Skip to content

CSS content generated by less/stylus preprocessor will serve content-type: application/javascript #843

Closed

Description

@chriswong
  1. the css content was process with preprocessor, such as karma-less-preprocessor
  2. karma/lib/preprocessor takes '.js' as suffix of file.contentPath in line 63.
  3. karma/lib/middleware/common line 39, mime.lookup with file.contentPath
  4. as the result of above, a requestUrl like /base/css/a.css, the content-type will response as 'application/javascript'

i'll send a pull request to fix it.

Activity

  1. vojtajina commented on Nov 30, 2013

    @vojtajina
    Contributor

    Yep, we should use file.path (which is the path that the file is being served under).

  2. vojtajina commented on Nov 30, 2013

    @vojtajina
    Contributor

    I actually already changed that in my local branch (while working on caching of the preprocessed files to save FS access).

  3. chriswong commented on Dec 2, 2013

    @chriswong
    Author

    ok, i'm waiting for ur latest release on npm.

  4. added a commit that references this issue on Dec 4, 2013
    69cd4eb
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions