[//lasso
/*----------------------------------------------------------------------------

[request_params]
Returns a map of items in the client request header.

Author: Jason Huck
Last Modified: Jun. 01, 2006
License: Artistic license <http://opensource.org/licenses/artistic-license.php>

Description:
Returns a map of items in the client request header.


Sample Usage:
request_params->find('Host');

-> 'www.omnipilot.com'


Downloaded from tagSwap.net on Feb. 14, 2007.
Latest version available from <http://tagSwap.net/request_params>.

----------------------------------------------------------------------------*/
		

define_tag(
	'params',
	-namespace='request_',
	-priority='replace',
	-description='Returns a map of the items in the request header.'
);
	local('in') = client_headers;
	#in->replace('\r\n','\r')&replace('\n','\r');
	#in = #in->split('\r');
	
	local('out' = map);
	
	iterate(#in, local('i'));
		local('name') = #i->split(':')->first;
		local('value') = #i->removeleading(#name + ':')&trim&;
		#out->insert(#name = #value);
	/iterate;

	return(@#out);
/define_tag;
]
