Lasso Soft Inc. > Home


AuthorBil Corry
LicensePublic Domain
Posted20 Jan 2006
Updated05 May 2006
More by this author...


Via header, sets content type to serve XHTML using content-negotiation.    It will force Lasso to send the page in the character set specified in Lasso Admin (default) or use the -encoding param.

Note: this will specify "application/xhtml+xml" as the content type for any browser that advertises it understands it.  Your XHTML page must be well-formed or the browser will complain instead of showing your webpage.

Sample Usage


Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.


	-description='Via header, sets content type to serve XHTML using content-negotiation.',


	// internal var that lets other ctags know it's XHTML
	var:'_lp_xhtml' = true;

	// set encoding
	if: !(local_defined:'encoding');
		local:'encoding' = $__encoding__; // use Lasso default encoding

	// set content type
	if: client_headers->(contains:'application/xhtml+xml'); // accepts XHTML content-type?
		content_type:'application/xhtml+xml; charset=' #encoding;
	else; // server XHTML as HTML content type
		content_type: 'text/html; charset=' #encoding;
	// set vary header
	if: !$__http_header__->(contains:'vary:');
		$__http_header__ += 'Vary: *\r\n';


Related Tags


No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft