Just received this email about updating RESTLETs S...
# suitescript
s
Just received this email about updating RESTLETs Subject:
Changes to Default Content-Type Header of RESTlet HTTP Responses
Copy code
You are receiving this notification because your NetSuite account has one or more RESTlet scripts that return HTML content. This notification is to inform you that the behavior of these scripts is targeted to change as of September 30, 2024.

...

If your RESTlet scripts are locked or belong to a SuiteApp, contact the SuiteApp owner. If it's a NetSuite SuiteApp, contact NetSuite Customer Support for assistance.

What is Changing?
Currently, any RESTlet script that returns HTML content is determined by the Content-Type header in the HTTP request. If the Content-Type header of the HTTP request has a value, the value gets passed to the HTTP response. If there is no Content-Type header defined in the HTTP request, the default value of the HTTP response Content-Type header is HTML (or text/html).

As of September 30, 2024, any RESTlet script that does not have a defined HTTP request Content-Type header will have a default HTTP response Content-Type header of plain text (or text/plain).
Required Actions
If you require any RESTlet scripts to have a return value in HTML format, you must update these scripts, otherwise the text/plain content type is preferred to avoid injection issues. Use the new N/scriptTypes/restlet module to set the RESTlet's HTTP response Content-Type header to text/html explicitly. Failure to update these scripts before September 30, 2024 will render your RESTlet responses as plain text instead of HTML after this date.
Copy code
See the following code sample for the updated RESTlet implementation:BeforeAfter

/**
 * BEFORE
 * @NApiVersion 2.1
 * @NScriptType restlet
 */
define([], () => {
 return {
    get() {
      return "<b>Hello World</b>,
	  from restlet!";
    },
 };



/**
 * AFTER
 * @NApiVersion 2.1
 * @NScriptType restlet
 */
define(["N/scriptTypes/restlet"], (restlet) => {
 return {
    get() {
       return restlet.createResponse({
          contentType: "text/html",
          content: "<b>Hello World</b>,
		  from restlet!"
       });
    },
 };
});
For more information about how to use the new N/scriptTypes/restlet module in your RESTlet scripts, see Help Topic N/scriptTypes/restlet Module.
🙏 1
Heck of a timeline.. Also, what’s with “contact your suiteapp” publisher? Seems like this needs to roll out to SUITEAPP developers prior to forcing it on customer accounts?
If they can tell that you have scripts returning HTML, why not create a search or page to review them, like they did with HTML Search Formulas…
netsuite 1
The whole thing here seems half-baked.
t
I was thinking the same thing @suitedev, they can tell us we have scripts running that are effected but not which ones.