diff --git a/FU.pm b/FU.pm index abdde9b..ffdc9bd 100644 --- a/FU.pm +++ b/FU.pm @@ -694,7 +694,6 @@ sub json { $FU::REQ->{json} ||= eval { FU::Util::json_parse($FU::REQ->{body}, utf8 => 1) } || fu->error(400, "JSON parse error: $@"); - return $FU::REQ->{json} if !@_; _getfield $FU::REQ->{json}, @_; } @@ -945,7 +944,7 @@ __END__ =head1 NAME -FU - Framework Ultimatum: A Lean and Efficient Zero-Dependency Web Framework. +FU - A Lean and Efficient Zero-Dependency Web Framework. =head1 EXPERIMENTAL @@ -1481,8 +1480,6 @@ Encode C<$data> as JSON (using C in L), set an appropriate C header and send it to the client. Calls C<< fu->done >>. -I Support schema-based normalization. - =item fu->send_file($root, $path) If a file identified by C<"$root/$path"> exists, set that as response and call diff --git a/FU/DebugImpl.pm b/FU/DebugImpl.pm index da5fc47..d7f0334 100644 --- a/FU/DebugImpl.pm +++ b/FU/DebugImpl.pm @@ -4,7 +4,7 @@ use v5.36; use experimental 'for_list'; use FU; use FU::XMLWriter ':html5_', 'fragment', 'xml_escape'; -use Time::HiRes 'time'; +use Time::HiRes 'time', 'clock_gettime', 'CLOCK_MONOTONIC'; use POSIX 'strftime'; sub fmtts { strftime '%Y-%m-%d %H:%M:%S UTC', gmtime shift } @@ -15,7 +15,8 @@ sub loc_($loc) { br_ if $_; my $l = $loc->[$_]; my $f = $_ == $#$loc ? '(main)' : $loc->[$_+1][3]; - txt_ "$l->[1]:$l->[2] $f"; + $f = "$l->[0]::$f" if $f !~ /^\Q$l->[0]/; + txt_ "$f @ $l->[1]:$l->[2]"; } } @@ -35,7 +36,7 @@ my @tabs = ( tr_ sub { td_ 'Path'; td_ fu->path }; tr_ sub { td_ 'Query'; td_ fu->query }; tr_ sub { td_ 'Client IP'; td_ fu->ip }; - tr_ sub { td_ 'Received'; td_ fmtts $FU::REQ->{trace_start} }; + tr_ sub { td_ 'Received'; td_ fmtts(time - (($FU::REQ->{trace_end}||clock_gettime(CLOCK_MONOTONIC)) - $FU::REQ->{trace_start})) }; }; h2_ 'Headers'; table_ sub { diff --git a/README.md b/README.md index 9cf7cb8..bf545b6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# FU - Framework Ultimatum: A Lean and Efficient Zero-Dependency Web Framework +# FU - A Lean and Efficient Zero-Dependency Web Framework -FU is a web development framework for Perl and a collection of handy utility -modules. +FU (Framework Ultimatum) is a web development framework for Perl and a +collection of handy utility modules. *Contributing:* Refer to my [contribution guidelines](https://dev.yorhel.nl/contributing). @@ -23,7 +23,6 @@ Things that may or may not happen: - FU::JSON - JSON::{XS,PP,etc}-compatible wrapper around FU::Util's JSON functions? I prolly won't need this myself, but could be handy. - FU::DBI - DBI wrapper with a FU::Pg-like API, for easier integration into FU. -- FU::Mailer - Simple sendmail wrapper # License