Mojo似乎想在响应中添加标题。给定上下文对象,是否有任何抑制标题的方法?
$r->get('/')->to( cb => sub {
my $c = shift;
# No headers for this response
} );
答案 0 :(得分:1)
就我而言,我正在使用Mojo::Server::CGI
。您可以看到问题on line 29和on line 35
return undef if $self->nph && !_write($res, 'get_start_line_chunk');
...
return undef unless _write($res, 'get_header_chunk');
您可以通过混入内部元素来解决此问题,
$c->res->content->_headers->{header_buffer} = '';
$c->res->{start_buffer} = '';