[cgi-devel] truncated post variable
Status: Beta
Brought to you by:
drrngrvy
|
From: <jc...@ol...> - 2011-09-05 23:51:09
|
Hello Darren,
I am struggling with the following issue. On a linux box with nginx as the
webserver
on the client's side, I am making the following jquery call:
function sign_up()
{
$("#sign_up_feedback").html('').hide();
$.post
( "/",
{ task: 'sign_up',
member_username: $('#member_username').val(),
member_password: $('#member_password').val(),
member_password_repeat: $('#member_password_repeat').val(),
member_first_name: $('#member_first_name').val(),
member_last_name: $('#member_last_name').val(),
member_phone: $('#member_phone').val(),
member_email: $('#member_email').val(),
member_corporation_id: $('#member_corporation_id').val(),
member_unit: $('#member_unit').val(),
member_card_number: $('#member_card_number').val(),
member_card_expiration: $('#member_card_expiration').val()
},
function(data)
{
$("#sign_up_feedback").html(data).show();
}
);
}
I have used similar functions, thousands of times but, this time,when I
read the post values server side
using
print_variables_(req.post, "POST");
with
template<typename Map>
void
print_variables_(Map& m, std::string title)
{
std::ostringstream os;
os << title << "\n";
if (m.empty())
{
os << "NONE\n";
}
else
{
for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i)
{
os << i->first << " = " << i->second << "\n";
}
}
os << "\n";
write_to_file("~/log_requests", os.str());
}
member_card_number is truncated to member_card! I looked at the http
headers and the nginx logs and member_card_number is not truncated.
I am very puzzled here as this has never really happened to me.
Where in the source code of the CGI library could I see where the parsing
of the http header is done?
Thank you very much
Jean-Christophe
|