dws has asked for the wisdom of the Perl Monks concerning the following question:
My webapp generate a form that contains a textarea, and several hidden fields. The final hidden field is a timetamp (as text, of course), for the file being edited. To prevent edit collisions, when the form is submitted, this timestamp is checked against the current file timestamp. If they don't match, the user gets an advisory page, and their edit isn't saved. This scheme, lightweight as it is, has been working fine for years.
Now, one of my users complains that he's suddenly unable to edit.
I add debugging code to the app, and notice, eventually, that when he submits the edit form, the last two characters of timestamp field--the final field in the form--have been truncated. We confirm (by viewing source) that our browsers are are seeing identical HTML for the HTML form. So something between his browser and the web server is screwing with his form submission.
As a workaround, I added a hidden field that contains some padding characters to the end of the form, on the assumption that it will get truncated instead of the timestamp field. My user can now save edits, and is now happy and less motivated to continue debugging. I've inspected the application code (a simple, vanilla CGI.pm CGI), and can see nothing that explains the problem. The relevant code is
where cgi_param() is simplymy $timestamp = $self->cgi_param("timestamp"); if ( -f $file && $timestamp != (stat($file))[9] || 0 ) { ...
and $self->{'cgi'} is a vanilla CGI instance.my $key = shift; return $self->{'cgi'}->param($key);
On further interrogation, the user admits to having recently installed some pop-up blocking software (Google toolbar and "Add/Subtract Pro"), but claims that he isn't have problems with any other site. It sure looks like one or both of the pop-up blockers (perhaps by interaction) are interfering with POSTs, perhaps by rewriting content-length or content. A Google search turns up nothing interesting, other than vague claims that ad blockers can do evil things.
Can anyone shed light on this? Pointers/wisdom will be appreciated.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: May be OT: Can ad blockers truncate POST data?
by liz (Monsignor) on Feb 10, 2004 at 20:45 UTC | |
|
Re: May be OT: Can ad blockers truncate POST data?
by ryantate (Friar) on Feb 11, 2004 at 01:01 UTC | |
by Anneq (Vicar) on Feb 11, 2004 at 10:17 UTC | |
by ryantate (Friar) on Feb 11, 2004 at 17:21 UTC | |
by Anneq (Vicar) on Feb 11, 2004 at 18:50 UTC | |
|
Re: May be OT: Can ad blockers truncate POST data?
by Abigail-II (Bishop) on Feb 10, 2004 at 20:14 UTC | |
by dws (Chancellor) on Feb 10, 2004 at 20:39 UTC | |
|
Re: May be OT: Can ad blockers truncate POST data?
by fraktalisman (Hermit) on Feb 11, 2004 at 15:59 UTC |