[Catalyst] Catalyst/Internet Explorer strangeness

Will Hawes info at whawes.co.uk
Mon Nov 21 17:13:50 CET 2005


I've noticed under recent releases that while running under the test 
server, I get some very strange behaviour from Internet Explorer. When 
submitting a form via HTTP post, it does one of the following:

1) Times out and shows the IE "Cannot find server or DNS error" page.
2) Sends the HTTP POST correctly, but then (according to the debug 
output from the test server) immediately sends a GET request to the same 
URI it just POSTed to.

This behaviour goes away when I run the same app under Apache/mod_perl. 
Everything works fine using both Firefox and Opera under the test server 
or Apache.

IE used to work just fine with the test server under 5.33. The problems 
seem to have started sometime around the upgrade from 5.33 to 5.49_01, 
although I upgrade quite frequently and am now running 5.56 so it's hard 
to say.

Code is along the lines of:

package My::C::Foo;
use strict;

sub edit : Regex('^.*/edit$') {
   my ( $self, $c, $pk ) = @_;
   $c->stash->{item} = My::M::Foo->retrieve($pk);
   $c->stash->{template} = 'edit';
}

sub do_edit : Regex('^.*/do_edit$') {
     my ( $self, $c, $pk ) = @_;

     my $item = $class->retrieve($pk);

     my $validation = {};
     $validation->{'missing_optional_valid'} = 1;
     $c->form( $validation );

     my $results = $c->form;

     if($results->has_missing or $results->has_invalid) {
         $c->forward('edit') && return;
     }

     $item->update_from_form( $c->form );
     $c->res->redirect( $c->req->base . $item->moniker . '/edit/' . 
$item->id );
}


Template is very simple also:

<form action="foo/do_edit" method="post">
	<input type="text" name="field1" />
	...
	<input type="submit" value="Save" />
</form>




More information about the Catalyst mailing list