Skip to content

Instantly share code, notes, and snippets.

/upgrade.diff Secret

Created January 27, 2017 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/82f15105133328719f43ee2ab4de3990 to your computer and use it in GitHub Desktop.
Save anonymous/82f15105133328719f43ee2ab4de3990 to your computer and use it in GitHub Desktop.
diff --git a/t/mojo/ioloop_tls.t b/t/mojo/ioloop_tls.t
index 288fb28c3..4892a13b6 100644
--- a/t/mojo/ioloop_tls.t
+++ b/t/mojo/ioloop_tls.t
@@ -33,12 +33,14 @@ use Mojo::IOLoop;
# Built-in certificate
my $loop = Mojo::IOLoop->new;
my $delay = $loop->delay;
+my $text = "\x01\x00\x00\x00\x00\x00\xD0\x00\x0A\x00\x0B\x00\x00\x00\x84\x0B";
+utf8::upgrade $text;
my ($server, $client);
my $end = $delay->begin;
my $id = $loop->server(
{address => '127.0.0.1', tls => 1} => sub {
my ($loop, $stream) = @_;
- $stream->write('test' => sub { shift->write('321') });
+ $stream->write($text => sub { shift->write('321') });
$stream->on(close => $end);
$stream->on(read => sub { $server .= pop });
}
@@ -56,7 +58,7 @@ $loop->client(
);
$delay->wait;
is $server, 'tset123', 'right content';
-is $client, 'test321', 'right content';
+is $client, "${text}321", 'right content';
# Valid client certificate
$delay = Mojo::IOLoop->delay;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment