Loïc Hoguin
5bb6438e10
Don't crash when cowboy_clock is not running
...
This can happen normally when Cowboy is restarted, for example.
Instead of failing requests when that happens, we degrade
gracefully and do a little more work to provide the current
date header.
2017-11-01 17:06:37 +00:00
Loïc Hoguin
43adacc760
Welcome to 2017
2017-01-02 19:36:36 +01:00
Loïc Hoguin
4aabb67562
Fix a compile error introduced in previous commit
2015-05-06 17:37:20 +03:00
Loïc Hoguin
40fa0b130c
Dialyzer fixes in cowboy_clock
...
This is what I get for merging blindly!
2015-05-06 17:24:55 +03:00
Alex Kovalev
817c6ed7c0
added a comment for non-obvious erlang:cancel_timer
2015-05-06 11:27:49 +03:00
Alex Kovalev
f25e452139
fixed cowboy_clock inbox overflow if system clock was changed
2015-05-06 11:27:47 +03:00
Loïc Hoguin
e2b5c21443
Drop R15 support
2014-07-12 14:19:29 +02:00
Loïc Hoguin
c9b9644aa3
Add +warn_missing_spec and fix specs
2014-03-27 11:30:44 +01:00
Loïc Hoguin
17af50812c
Remove outdated comments, all edoc, plus a few minor tweaks
2014-03-26 19:05:59 +01:00
Loïc Hoguin
903594bb87
Update copyright years
2014-02-06 19:57:23 +01:00
Loïc Hoguin
faf64524c6
Move cookie parsing/building code to cowlib
...
The code for parsing has also been rewritten to be more efficient
and to be able to handle cookie values with space inside them properly.
Update cowlib to 0.2.0.
2013-10-23 16:35:23 +02:00
Egobrain
3bf5b46786
Removed asserts from unit tests
2013-04-26 17:08:53 +04:00
Loïc Hoguin
54063de2ff
Hello 2013
2013-01-04 15:10:03 +01:00
Loïc Hoguin
73d86057f2
Fix small error in doc comment
2013-01-03 22:31:55 +01:00
Loïc Hoguin
27da09282d
Make cookies use universal time instead of local time
...
Includes:
* cowboy_clock:rfc2109/1 now expects UTC datetime
* Rewrite of the cookie code to cowboy_http
* Removal of cowboy_cookies
* Add type cowboy_req:cookie_opts/0
Cookies should now be set using cowboy_req:set_resp_cookie/3.
Code calling cowboy_cookies directly will need to be updated.
2012-12-07 15:13:35 +01:00
Loïc Hoguin
8bc6bde62f
Remove the dependency on httpd_util
...
Add the function cowboy_clock:rfc1123/1 that formats the given
date to the RFC1123 format.
2012-12-03 15:57:27 +01:00
Loïc Hoguin
34021666cb
Don't use decode_packet/3 for parsing the headers
...
Header names are now binaries. Since header names are case insensitive
they are all converted to lowercase. For example: <<"content-length">>.
The max_line_length option was removed. Three new options have been
added instead:
* max_request_line_length (defaults to 4096)
* max_header_name_length (defaults to 64)
* max_header_value_length (defaults to 4096)
2012-09-21 09:18:56 +02:00
Loïc Hoguin
13b743ba26
Include the eunit file only if TEST is defined
2012-09-17 13:57:29 +02:00
Loïc Hoguin
cc2e084d45
Update behaviours for R15B+
...
This effectively drops the R14B compatibility.
The cowboy_req:req() type will be introduced in a future commit.
It refers to the #http_req{} record.
2012-08-27 12:50:00 +02:00
Loïc Hoguin
a5e75219f0
Have only one -export and -export_type per line
...
This should make easier spotting additions and removals in commits.
2012-08-27 12:16:07 +02:00
Loïc Hoguin
0c2e2224e3
Update version to 0.6.0
...
Also update the CHANGELOG and copyright years.
2012-05-23 14:53:48 +02:00
Magnus Klaar
3376b7295e
Fix issue #157 relating to daylight savings time.
2012-03-09 20:42:12 +01:00
Loïc Hoguin
156c84ff29
Use calendar date and time types exported since R14B04
...
Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types.
2011-12-26 10:17:29 +01:00
Loïc Hoguin
d858153fce
Use cowboy_clock types in cowboy_cookies instead of calendar
...
Until calendar exports them at least.
2011-08-11 10:24:50 +02:00
Loïc Hoguin
528d0ebffd
Small cosmetic changes and doc update to the cookie patch
2011-07-26 13:58:48 +02:00
Tom Burdick
a29ccb070b
Add cowboy_cookies for cookie creation and parsing
...
Based on Mochi Media, Inc.'s work in Mochiweb.
Conflicts:
rebar.config
2011-07-26 13:52:21 +02:00
Loïc Hoguin
108a491f55
Add documentation for the public interface.
...
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-07-06 17:42:20 +02:00
Loïc Hoguin
58267689f0
Add the remaining missing specs
...
Found thanks to warn_missing_spec and added with the help of typer.
Eunit functions do not have specs yet however.
2011-06-27 23:36:17 +02:00
Loïc Hoguin
a93eb02646
Fix a binary warning in cowboy_clock.
...
Just a change in the order of arguments of update_rfc1123.
2011-06-07 17:26:53 +02:00
Loïc Hoguin
3e55cb62c9
Refresh the type specifications.
...
Following discussions on #erlounge.
Also fixes compilation in R14B03 and fixes a few underspecs
dialyzer warnings.
2011-05-25 23:02:40 +02:00
Loïc Hoguin
9f06bac7bf
Only try to update the Date field once every seconds.
2011-05-14 18:50:43 +02:00
Loïc Hoguin
95006c3291
Add the required Date header in the HTTP replies.
...
The formatted date is generated and kept up to date regularly
by a gen_server process storing it in the cowboy_clock ets table.
Then it is retrieved by other processes simply by reading the table.
2011-05-14 15:20:12 +02:00