-
Notifications
You must be signed in to change notification settings - Fork 382
Open
Description
Some default headers require dynamic processing. For example setting the 'Date' header field on each response.
settings->set_default_header( "Date", [ ]( void ) -> string
{
const time_t now = ( date == 0 ) ? time( 0 ) : date;
struct tm components = { };
gmtime_r( &now, &components );
char datastamp[ 50 ] = { };
strftime( datastamp, sizeof datastamp, "%a, %d %b %Y %H:%M:%S GMT", &components );
return datastamp;
} );