From 24eb6f3f9e93a72063c57923fcb88cb5cb5e8c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 21 Mar 2014 11:04:09 +0100 Subject: Improve specs in cow_http --- src/cow_http.erl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cow_http.erl b/src/cow_http.erl index ac8f556..d10ff4f 100644 --- a/src/cow_http.erl +++ b/src/cow_http.erl @@ -24,7 +24,7 @@ -type version() :: 'HTTP/1.0' | 'HTTP/1.1'. -type status() :: 100..999. --type headers() :: [{binary(), binary()}]. +-type headers() :: [{binary(), iodata()}]. -include("cow_inline.hrl"). @@ -106,7 +106,7 @@ horse_parse_status_line_other() -> %% @doc Parse the list of headers. --spec parse_headers(binary()) -> {headers(), binary()}. +-spec parse_headers(binary()) -> {[{binary(), binary()}], binary()}. parse_headers(Data) -> parse_header(Data, []). @@ -262,11 +262,9 @@ parse_fullpath_test() -> %% @doc Convert an HTTP version to atom. --spec parse_version(binary()) -> 'HTTP/1.1' | 'HTTP/1.0'. -parse_version(<<"HTTP/1.1">>) -> - 'HTTP/1.1'; -parse_version(<<"HTTP/1.0">>) -> - 'HTTP/1.0'. +-spec parse_version(binary()) -> version(). +parse_version(<<"HTTP/1.1">>) -> 'HTTP/1.1'; +parse_version(<<"HTTP/1.0">>) -> 'HTTP/1.0'. -ifdef(TEST). parse_version_test() -> -- cgit v1.2.3