Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ t/CAN_TALK_TO_OURSELF
t/live/ENABLED
.vscode
xx*
MYMETA.json
MYMETA.yml
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Change history for HTML-Form

{{$NEXT}}
- Fix form.t compatibility with HTTP::Message 7.01+ (GH#57) (Copilot and
Gianni Ceccarelli)

6.12 2024-10-18 16:19:06Z
- Fix CRLF normalization with HTTP::Message 7.00 (GH#53) (Graham Knop)
Expand Down
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ user = libwww-perl

[Prereqs]
Encode = 2
HTTP::Request = 6
HTTP::Request = 7.01
HTTP::Request::Common = 6.03
perl = 5.008001
Test::More = 0.96
Expand Down
17 changes: 11 additions & 6 deletions t/form.t
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ EOT
#print $f->dump;
#print $f->click->as_string;

is( $f->click->as_string, <<'EOT');
chomp(my $expected_advanced = <<'EOT');
POST http://localhost/
Content-Length: 86
Content-Type: application/x-www-form-urlencoded

i.x=1&i.y=1&c=on&r=b&t=&p=&tel=&date=&h=xyzzy&f=&x=&a=%0D%0Aabc%0D%0A+++&s=bar&m=a&m=b
EOT
is( $f->click->as_string, $expected_advanced);

is( @warn, 1 );
like( $warn[0], qr/^Unknown input type 'xyzzy'/ );
Expand Down Expand Up @@ -463,22 +464,24 @@ EOT
ok( $f->find_input("randomkey") );
is( $f->find_input("randomkey")->challenge, "1234567890" );
is( $f->find_input("randomkey")->keytype, "rsa" );
is( $f->click->as_string, <<EOT);
chomp(my $expected_keygen = <<EOT);
POST http://example.com/secure/keygen/test.cgi
Content-Length: 19
Content-Type: application/x-www-form-urlencoded

Field1=Default+Text
EOT
is( $f->click->as_string, $expected_keygen);

$f->value( randomkey => "foo" );
is( $f->click->as_string, <<EOT);
chomp(my $expected_keygen_foo = <<EOT);
POST http://example.com/secure/keygen/test.cgi
Content-Length: 33
Content-Type: application/x-www-form-urlencoded

randomkey=foo&Field1=Default+Text
EOT
is( $f->click->as_string, $expected_keygen_foo);

$f = HTML::Form->parse( <<EOT, "http://www.example.com" );
<form ACTION="http://example.com/">
Expand Down Expand Up @@ -602,13 +605,14 @@ $f = HTML::Form->parse( <<EOT, base => "http://localhost/" );
</form>
EOT

is( $f->click->as_string, <<EOT);
chomp(my $expected_button_go = <<EOT);
POST http://localhost/
Content-Length: 9
Content-Type: application/x-www-form-urlencoded

submit=go
EOT
is( $f->click->as_string, $expected_button_go);

$f = HTML::Form->parse( <<EOT, base => "http://localhost/" );
<form method=post>
Expand All @@ -617,13 +621,14 @@ $f = HTML::Form->parse( <<EOT, base => "http://localhost/" );
</form>
EOT

is( $f->click->as_string, <<EOT);
chomp(my $expected_button_empty = <<EOT);
POST http://localhost/
Content-Length: 7
Content-Type: application/x-www-form-urlencoded

submit=
EOT
is( $f->click->as_string, $expected_button_empty);

# select with a name followed by select without a name GH#2
$f = HTML::Form->parse( <<EOT, "http://localhost/" );
Expand Down Expand Up @@ -674,4 +679,4 @@ GET http://localhost/target.html?foo=option+in+named
EOT
}

done_testing;
done_testing;
Loading