Menu

#1954 Bad guessContentType for javascript

Latest SVN
closed
RBRi
None
1
2018-03-07
2018-03-06
No

When loading local javascript (file://), lot of warnings appear:

WARN com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl - Obsolete content type encountered: 'text/javascript'.

this is because com.gargoylesoftware.htmlunit.WebClient.guessContentType returns "text/javascript" for .js files.
HtmlPage.loadJavaScriptFromUrl checks contenttype just after receiving the response, so the warning.

Proposed fix:
return "application/javascript" for .js files in guessContentType

Discussion

  • RBRi

    RBRi - 2018-03-07

    Good point :-)
    Fixed in SVN; a fresh build will be available on our CI build server shortly.

    Will inform via twitter (www.twitter.com/htmlunit) if a new snapshot build is in the repos.

    Many thanks for your report, enjoy using HtmlUnit.

     
  • RBRi

    RBRi - 2018-03-07
    • status: open --> closed
    • assigned_to: RBRi
     

Log in to post a comment.

Monday.com Logo