From de07b0b267516460491d76a53de2c3b6cd057b1e Mon Sep 17 00:00:00 2001 From: Marko Mindek Date: Wed, 8 Jan 2025 13:30:14 +0100 Subject: [PATCH] fix: cowboy_static misc specs --- src/cowboy_static.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl index 4369bf2f..c26987e9 100644 --- a/src/cowboy_static.erl +++ b/src/cowboy_static.erl @@ -347,7 +347,7 @@ content_types_provided(Req, State={Path, _, Extra}) when is_list(Extra) -> %% Detect the charset of the file. -spec charsets_provided(Req, State) - -> {[binary()], Req, State} + -> {[binary()], Req, State} | no_call when State::state(). charsets_provided(Req, State={Path, _, Extra}) -> case lists:keyfind(charset, 1, Extra) of @@ -381,7 +381,7 @@ resource_exists(Req, State) -> %% Generate an etag for the file. -spec generate_etag(Req, State) - -> {{strong | weak, binary()}, Req, State} + -> {{strong | weak, binary() | undefined}, Req, State} when State::state(). generate_etag(Req, State={Path, {_, #file_info{size=Size, mtime=Mtime}}, Extra}) -> @@ -408,7 +408,7 @@ last_modified(Req, State={_, {_, #file_info{mtime=Modified}}, _}) -> %% Stream the file. -spec get_file(Req, State) - -> {{sendfile, 0, non_neg_integer(), binary()}, Req, State} + -> {{sendfile, 0, non_neg_integer(), binary()} | binary(), Req, State} when State::state(). get_file(Req, State={Path, {direct, #file_info{size=Size}}, _}) -> {{sendfile, 0, Size, Path}, Req, State};