Specified Content-Type not always honored Notes 6.5.x

I normally use a simple document for stylesheets and JavaScript libraries in Notes. The form has a field for the “filename” (e.g. my_lib.js) and a field for the data. Until now I had been using a richtext field called HTML for the contents and changed the Content-Type on the form properties as appropriate (text/javascript, text/css etc.). This was working nicely until I created a page using the Strict XHTML DOC-TYPE.

It became an issue because Firefox requires that the Content-Type is text/css for stylesheets when rendering in Strict mode. Otherwise the stylesheet wont be used. Using the Live HTTP Headers extension for Firefox I saw that Domino kept setting the Content-Type to text/html even though the form properties was set to text/css.

Changing the richtext field name from HTML to Body solved the problem. Apparently Domino will not honor the specified Content-Type when the form has a field called HTML.

One of those things in Domino…

Published by

lekkim

Positive, competent, out-spoken, frank and customer focused architect and developer with a strong foundation in web, cloud and product development. I'm a strong advocate for API first and cloud based solutions and development. I have a knack for being able to communicate and present technically complicated matters in conference, customer and training settings. I've previously acted as team member and leader in a product organisation.

2 thoughts on “Specified Content-Type not always honored Notes 6.5.x”

  1. “HTML” has been a special item name used for efficient serving of pre-formatted HTML since the early days of Domino on the web. I can’t remember when I learned about this, but it must have been after the two-part series on Domino 4.6 architecture that I wrote for the old Notes.Net web site because I just checked and I didn’t mention it there. Anyhow, whenever a document contains an item named “HTML”, the contents of that item are sent immediately to the browser. The server never even looks at the “Form” item, and therefore it never even loads the form design element into memory, so it actually makes sense that properties of the form can’t be honored… but I don’t know if this has ever been documented.

    -rich

  2. Yes I figured so as well but just thought it was funny and one of those things you just need to know in Domino. I started using the HTML field name for the reasons you decsribe but never in my wildest dreams imagined that it would override the specified Content-Type since the possibility to override the Content-Type was first added in Domino 6.

    /lekkim

Comments are closed.