.Inline method

Executed for rendering a file within a HTML document. Also called, inlining the file.

When a file implements the .Inline interface by having an .Inline file on its type chain, the file is said to be a content.

Summary

  • The returned response body MUST contain HTML5 code valid within the <body> tag.
  • You may require scripts, stylesheets etc via a string attribute head defined on the response file. Tags defined in this attribute are expected to be propagated by the callee. Note that the <title> tag is not allowed, setting it is the concern of the top-most transaction (responding to a request as defined in .Request).
  • The response status-code MAY be set. By default it is 0 which has the same meaning as 200. Any non 0 or 200 status-code is expected to be propagated by the callee and returned to the client. 3xx beats anything under 300, 4xx beats 3xx, 5xx beats 4xx. The first from any status-code category (200, 3xx, 4xx, 5xx) will be returned.
  • To add Content-Security-Policy rules to the HTTP response, you can add them to a string attribute named content-security-policy of the response file. (Some engines will automatically pick up the rules if a .ContentSecurityPolicy file is defined on the app, before the .Inline method is executed.)

Note that the .Inline method is executed transactionally in an isolated environment. Upon a server error or a 5xx statusCode, the entire transaction will be rolled back. (If you removed files, those changes will not take effect.) This saves you from implementing a rollback logic yourself.