>
> As I read in docs I know: "defaults to returning the first extension if no 
> preference could be detected". But why I get an empty string after 
> $c->accepts('json') if I have html content? But I get "json" if I have GIF 
> content?
>

Your test must be flawed.

  $ perl -Mojo -E 'a(sub { $_->render(text => $_->accepts("json") // 
"nothing") })->start' get /.json
  json

  $ perl -Mojo -E 'a(sub { $_->render(text => $_->accepts("json") // 
"nothing") })->start' get /.html
  nothing

  $ perl -Mojo -E 'a(sub { $_->render(text => $_->accepts("json") // 
"nothing") })->start' get /.gif
  nothing

--
sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to