NAME
Langertha::Knarr::PSGI::FakeReq - Header access on a PSGI environment, shaped like a Net::Async::HTTP::Server request
VERSION
version 1.102
DESCRIPTION
Internal to Langertha::Knarr::PSGI: wraps a PSGI $env so the Knarr code shared with the native server (auth check, protocol parsers, raw passthrough) can read request headers and the path the way it reads them from a Net::Async::HTTP::Server::Request.
new
my $req = Langertha::Knarr::PSGI::FakeReq->new($env);
path
my $path = $req->path; # /api/generate
The request path (PATH_INFO), like "path" in Net::Async::HTTP::Server::Request; the Ollama protocol reads it to tell /api/generate from /api/chat.
header
my $value = $req->header('x-api-key');
The value of one request header, undef when it was not sent.
headers
for my $pair ( $req->headers ) { my ($name, $value) = @$pair; ... }
All request headers as [ name, value ] pairs, names lower-cased with dashes (PSGI keeps only the CGI form of a name).
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-knarr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.