aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_req.erl
AgeCommit message (Collapse)Author
2011-12-22Add 'Upgrade' header parsingLoïc Hoguin
Not parsing product tokens, I don't see much point.
2011-12-19Add meta/2 and meta/3 to cowboy_http_req to save useful protocol informationLoïc Hoguin
* cowboy_http_protocol now defines 'websocket_version' as metadata. * cowboy_http_rest now defines 'media_type', 'language', 'charset' as metadata.
2011-12-19Add missing p_headers and cookies to compacted valuesLoïc Hoguin
2011-12-16update type of resp_body to iodataMagnus Klaar
resp_body is set by cowboy_http_req:set_resp_body/2 which accepts the input type iodata(). Update the resp_body field to use the same type. Also update the cowboy_http_req:has_resp_body/2 function to use the iolist_size/1 which works with both binary() and iolist() values instead of the byte_size/1 function which only works with binary() values.
2011-12-08Merge branch 'master' of https://github.com/erlyvideo/cowboyLoïc Hoguin
Just fixed the indentation a bit.
2011-12-08peer_addr/1 functionMax Lapshin
2011-12-07Merge branch 'noquoted' of https://github.com/klaar/cowboyLoïc Hoguin
2011-12-07replace quoted:from_url with cowboy_http:urldecodeMagnus Klaar
This change makes the dependency on quoted optional by adding a minimal urldecode function to cowboy. A protocol option for setting the urldecoding function has been added to the cowboy_http_protocol module. The default value for this option is set to be equivalent to the default settings for quoted. {fun cowboy_http:urldecode/2, crash} A note has been added in the README to document how to use quoted instead of this function. A field to store this option value has been added to the state record in the cowboy_http_protocol module and the http_req record in include/http.hrl Functions that previously used quoted:from_url/1 has been updated to require an equivalent function in addition to the previously required arguments. This change removes a C compiler from the build requirements of cowboy. It also removes the requirement to cross compile the code if the target arch/OS is different from the arch/OS used to build it.
2011-12-07Add cowboy_http_req:set_resp_cookie/4Loïc Hoguin
Pretty much just an alias for a combination of set_resp_header and cookie.
2011-12-06Simplify the guards for cowboy_http_req:body/2Loïc Hoguin
2011-12-05The semantics for a missing 'If-Match' aren't the same as '*'Loïc Hoguin
2011-12-05Fix specs to allow headers as iodata() and not just binary()Loïc Hoguin
2011-11-28Add set_resp_header/3 and set_resp_body/2 to cowboy_http_reqLoïc Hoguin
These functions allow to set response headers and body in advance, before calling any of the reply functions. Also add has_resp_header/2 and has_resp_body/1 to check if the given response headers have already been set.
2011-11-24Fix default parsed values for the Accept and Accept-* headersLoïc Hoguin
2011-11-10Support 'Content-Type' in parse_header/2Anthony Ramine
2011-11-09Add 'If-Match' and 'If-None-Match' to parse_header/2Loïc Hoguin
2011-11-07Fix reading the request body when Length < byte_size(Buffer)Loïc Hoguin
2011-11-07Add 'Accept-Language' to cowboy_http_req:parse_header/2Loïc Hoguin
2011-11-05Add 'If-Modified-Since' and 'If-Unmodified-Since' to parse_header/2Loïc Hoguin
Implementing the full HTTP-date type (RFC1123, RFC850, asctime).
2011-11-04Merge branch 'parse_header-content-length' of https://github.com/nox/cowboyLoïc Hoguin
Conflicts: src/cowboy_http.erl
2011-11-04Support 'Content-Length' in parse_header/2Anthony Ramine
2011-11-04Rename cowboy_http:charset/2 to conneg/2 and use it for Accept-EncodingLoïc Hoguin
Sorry I apparently used an outdated RFC when I was doing this.
2011-10-29Fix cowboy_http_req:chunk/2 specPaul Oliver
2011-10-26Add 'Accept-Charset' to cowboy_http_req:parse_header/2Loïc Hoguin
2011-10-26Add 'Accept-Encoding' to cowboy_http_req:parse_header/2Loïc Hoguin
2011-10-26Add 'Accept' header parsingLoïc Hoguin
Rework the cowboy_http_req:parse_header/2 function while I was at it.
2011-10-20Parse Connection header tokens in a case-insensitive mannerLoïc Hoguin
2011-10-20Add a cowboy_http_req:upgrade_reply/3 function and use it for websocketsLoïc Hoguin
This function doesn't try to add any additional header besides the Connection: Upgrade header. It also doesn't accept a body. It should be used for the intermediate reply to an upgrade process, before the real reply is sent (if any, for example when using TLS).
2011-10-17Rewrite the token list parsing into separate, modulable functionsLoïc Hoguin
Introduce cowboy_http's list/2, nonempty_list/2, token/2 functions.
2011-10-13Add shortcuts to reply functionsLoïc Hoguin
New functions are reply/2, reply/3, chunked_reply/2 in cowboy_http_req.
2011-10-13Rename a variable from Code to StatusLoïc Hoguin
2011-10-07Fix a crash in response_connection when Name is an atom =/= 'Connection'Loïc Hoguin
2011-10-06Close the connection when the application sends Connection: closeLoïc Hoguin
Now Cowboy checks headers sent to the client for the 'Connection' header value, parses it, and checks whether it contains a 'close' or 'keep-alive' value. It makes sure to close or keep the connection alive depending on the value found there, if any. Also change chunked replies to not close the connection by default unless the application requests it.
2011-10-06Fix a crash in websocket_handshake when cowboy_http_req:compact/1 is usedLoïc Hoguin
Also add a call to compact/1 in the websocket test handler so we may catch bugs related to it faster later on.
2011-10-05Remove the 'HEAD' chunked_reply/3 clauseLoïc Hoguin
From the RFC: The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request.
2011-10-05Parse 'Connection' headers as a list of tokensLoïc Hoguin
Replaces the 'Connection' interpretation in cowboy_http_protocol from raw value to the parsed value, looking for a single token matching close/keep-alive instead of the whole raw value (which could contain more than one token, for example with Firefox 6+ using websocket). Introduce the functions cowboy_http_req:parse_header/2 and /3 to semantically parse the header values and return a proper Erlang term.
2011-10-01Get rid of a binary construct in cowboy_http_reqLoïc Hoguin
Thanks to @klaar for pointing it out in ticket #59.
2011-10-01Rename the type cowboy_dispatcher:path_tokens/0 to :tokens/0Loïc Hoguin
2011-10-01Merge branch 'path-split-doc' of https://github.com/klaar/cowboyLoïc Hoguin
2011-09-29add note to split_path/1 and path/1 on escaped /Magnus Klaar
2011-09-06Fix the handling of the HEAD requestsAli Sabil
Responses to the HEAD requests used to include an response body.
2011-07-26Fail early in cookie-related API functionsTom Burdick
2011-07-26Implement cookies in cowboy_http_reqTom Burdick
2011-07-20URL decode query stringsLoïc Hoguin
Should be good for both GET and POST query strings. This adds https://github.com/klaar/quoted.erl as a dependency. Props to klaar for this code.
2011-07-18Fail fast when a wrong type is given to API functionsLoïc Hoguin
Idea given by bfrog, fixes issue #34.
2011-07-06Add documentation for the public interface.Loïc Hoguin
This is probably not perfect yet but it should be better than nothing. We'll improve things with feedback received from the many users.
2011-06-30Fix the @equiv EDoc tagsLoïc Hoguin
2011-06-01Add function cowboy_http_req:compact/1 to regain memory.Loïc Hoguin
It removes all the non-essential data from the HTTP request record. It allows some applications to make better use of their memory, for example websockets which do not need to keep all the headers information and can simply discard it using this function.
2011-05-25Refresh the type specifications.Loïc Hoguin
Following discussions on #erlounge. Also fixes compilation in R14B03 and fixes a few underspecs dialyzer warnings.
2011-05-16Merge remote-tracking branch 'nox/path-info'Loïc Hoguin