Skip to content

Commit

Permalink
added fun example for content negotiation with static files
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 30, 2014
1 parent 32aed5e commit c93a5b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -728,6 +728,11 @@ served automatically from a C<public> directory if it exists.
$ mv mojolicious.tar.gz public/mojolicious.tar.gz
Both have a higher precedence than routes for C<GET> and C<HEAD> requests.
Content negotiation with C<Range>, C<If-None-Match> and C<If-Modified-Since>
headers is supported and can be easily tested with
L<Mojolicious::Command::get>.
$ ./myapp.pl get /something.js -v -H 'Host: bytes=2-4'
=head2 External templates
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Static.pm
Expand Up @@ -169,8 +169,8 @@ Mojolicious::Static - Serve static files
=head1 DESCRIPTION
L<Mojolicious::Static> is a static file server with C<Range> and
C<If-Modified-Since> support based on
L<Mojolicious::Static> is a static file server with C<Range>,
C<If-Modified-Since> and C<If-None-Match> support based on
L<RFC 7232|http://tools.ietf.org/html/rfc7232> and
L<RFC 7233|http://tools.ietf.org/html/rfc7233>.
Expand Down Expand Up @@ -259,8 +259,8 @@ that this method does not protect from traversing to parent directories.
$static->serve_asset(Mojolicious::Controller->new, Mojo::Asset::File->new);
Serve a L<Mojo::Asset::File> or L<Mojo::Asset::Memory> object with C<Range>
and C<If-Modified-Since> support.
Serve a L<Mojo::Asset::File> or L<Mojo::Asset::Memory> object with C<Range>,
C<If-Modified-Since> and C<If-None-Match> support.
=head1 SEE ALSO
Expand Down

0 comments on commit c93a5b9

Please sign in to comment.