Created
June 25, 2014 09:21
-
-
Save jhthorsen/75e51a92f4e0f589a44f to your computer and use it in GitHub Desktop.
How to make a response without headers, http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
package No::Headers; | |
use Mojo::Base "Mojo::Headers"; | |
sub to_string { "" }; | |
package main; | |
use Mojolicious::Lite; | |
get "/" => sub { | |
my $c = shift; | |
$c->res->content->headers(No::Headers->new) if $c->param('x'); | |
$c->render(text => "test\n"); | |
}; | |
# MOJO_USERAGENT_DEBUG=1 perl without_header.pl get "/?x=1" | |
app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment