Jonathan Ong
b7b1c0fd44
better 404 handling
2013-12-29 22:26:19 -08:00
Jonathan Ong
51da356a5f
debug: check for fn._name as well
2013-12-29 16:04:06 -08:00
Jonathan Ong
7fe4133b4a
refactor: move content negotiation to accepts
2013-12-27 18:56:02 -08:00
Jonathan Ong
0d9336622c
use yield *next internally
2013-12-22 14:48:28 -08:00
mako-taco
9fe483ca76
handle manually written responses
2013-12-22 14:46:36 -08:00
Jonathan Ong
879293f548
use on-socket-error
2013-12-20 14:39:53 -08:00
Jonathan Ong
61d437d746
remove next
in callback for now
...
revisit mounting later
2013-12-19 23:13:37 -08:00
Jonathan Ong
38d5bad4d1
bumpity boop co
2013-12-19 22:33:35 -08:00
Jonathan Ong
938a67c94f
lint: remove unused requires
...
duh.
2013-12-19 21:16:19 -08:00
Jonathan Ong
34104c9af3
refactor: allow any streams with .pipe method
2013-12-19 21:14:47 -08:00
TJ Holowaychuk
70971dcb53
add GeneratorFunction assertion for app.use(). Closes #120
...
breaks old old shit but thats ok, super early in the game
2013-12-19 10:03:08 -08:00
TJ Holowaychuk
171892c669
fix: cleanup socker error handler on response
2013-12-19 08:53:48 -08:00
TJ Holowaychuk
1769f9c431
add socket error-handling. Closes #114
2013-12-17 17:37:35 -08:00
TJ Holowaychuk
309f2ac00e
add debug() for .listen() and .keys=
2013-11-26 21:26:05 -08:00
Jonathan Ong
1dd1d02db0
app.respond: support 205 status codes as no-content
...
pretty new to me, but it’s basically the same as 204
2013-11-19 22:20:17 -08:00
Jonathan Ong
9407d7776c
context: cross-reference request and response
2013-11-18 14:10:11 -08:00
TJ Holowaychuk
cb682ed904
add body.close check for HEAD requests
2013-11-15 11:33:14 -08:00
TJ Holowaychuk
27d1336af5
Merge pull request #89 from koajs/keygrip
...
add keygrip support
2013-11-15 11:31:23 -08:00
TJ Holowaychuk
f3a6f6ae39
fix stream leak on HEAD. Closes #91
2013-11-15 10:49:28 -08:00
TJ Holowaychuk
f4b7f279ea
ocd
2013-11-15 10:09:56 -08:00
Jonathan Ong
0362c8e457
add app.keys support
2013-11-15 10:04:07 -08:00
Jonathan Ong
18c2cd1dac
this.originalUrl && this.request.originalUrl
2013-11-14 14:18:05 -08:00
Jonathan Ong
0be1442111
expose app-specific prototypes, cleanup/fix tests
2013-11-13 18:41:40 -08:00
Jonathan Ong
accb1d6a61
pass an optional next
to app.callback()
2013-11-08 01:17:41 -08:00
Jonathan Ong
2a7b6d07bf
remove unused var
2013-11-08 01:14:43 -08:00
Jonathan Ong
1bcf9b413f
remove unnecessary closure
2013-11-08 01:04:26 -08:00
TJ Holowaychuk
c1bed668bd
remove app.context() for now
...
get away from promoting the extension of prototypes, aside
from it looking better there isnt really a compelling reason
to allow this
2013-11-07 17:05:26 -08:00
TJ Holowaychuk
2d35cdff50
add new style middleware support through @jonathanong's koa-compose patch
2013-11-07 16:15:47 -08:00
Jonathan Ong
3c3b81b960
Merge pull request #60 from jonathanong/warn-context-overwrite
...
debug context: notify if a property is being overwritten
2013-10-25 03:49:23 -07:00
Jonathan Ong
cb60fb872a
only listen to stream errors if not already
2013-10-14 22:40:02 -07:00
TJ Holowaychuk
1810977700
update co to 2.0
2013-10-14 16:50:05 -07:00
Jonathan Ong
df367e0749
debug: notify if a property is being overwritten
2013-10-05 12:56:36 -07:00
Jonathan Ong
98a386a485
bind .onerror to context
2013-10-05 12:32:05 -07:00
Jonathan Ong
4aa75a1164
cleanup trailing whitespace in .js files
2013-10-05 12:27:15 -07:00
TJ Holowaychuk
11913f5e4e
add ctx.body= setter
...
this prevents a bunch of redundant checks that middleware may need to
check response length, type etc. the less code floating around based
on our supported response body types the better, giving us more freedom
to change these as needed, and just less error-prone code in general.
2013-09-14 15:54:17 -07:00
TJ Holowaychuk
7a26886040
change app.onerror to ignore 404s
...
so you can easily unwind the stack for 404s
2013-09-13 20:54:52 -07:00
TJ Holowaychuk
92b741ac0a
remove socket error handling, use server "clientError"
2013-09-08 11:44:45 -07:00
TJ Holowaychuk
cf54f7d7d5
remove a console.log
2013-09-08 11:41:52 -07:00
TJ Holowaychuk
2fe83a4e3d
add failing socket error handling test
2013-09-08 11:41:43 -07:00
TJ Holowaychuk
02ae4f787d
fix socket "error" handling
...
always has clientError now
2013-09-08 11:27:16 -07:00
TJ Holowaychuk
67b49cf82d
remove unnecessary .bind()
2013-09-08 09:37:33 -07:00
TJ Holowaychuk
f6161918ee
Merge branch 'master' of github.com:koajs/koa
2013-09-02 18:29:04 -07:00
Karl Böhlmark
520df772ef
use byteLength when calculating content-length
2013-09-02 23:55:38 +02:00
TJ Holowaychuk
7754a3535a
move downstream logic to response middleware
2013-09-01 16:27:03 -07:00
TJ Holowaychuk
b3761b5da0
Merge branch 'master' of github.com:koajs/koa
2013-08-31 09:17:16 -07:00
Kim Joar Bekkelund
baefcacff9
typo
2013-08-30 23:09:18 +02:00
TJ Holowaychuk
32d65cfe91
add basic instrumentation
2013-08-28 21:10:25 -07:00
TJ Holowaychuk
fae98c10ec
add context debug()
2013-08-27 21:24:53 -07:00
TJ Holowaychuk
ddc7347afe
change "unnamed" middleware to -, less junk output
2013-08-27 21:23:11 -07:00
TJ Holowaychuk
99895aa215
change app to emit "error" events instead of app.error(fn)
2013-08-27 20:24:04 -07:00
TJ Holowaychuk
3439437c18
add app.error(fn). Closes #4
2013-08-22 18:47:07 -07:00
TJ Holowaychuk
832a1dcc1e
change socket error listener to just use length
2013-08-22 11:53:14 -07:00
TJ Holowaychuk
4e4fcfc642
fix socket error handler event listener leak
2013-08-22 11:52:22 -07:00
TJ Holowaychuk
fe89dc3783
add socket error-handling. Closes #6
...
otherwise node just explodes, not a good default
2013-08-21 19:52:01 -07:00
TJ Holowaychuk
b4b0789d7a
fix .onerror bind for stream "error" handling
2013-08-21 19:50:32 -07:00
TJ Holowaychuk
9d7720f2d8
change .outputErrors to false for "test" env only
...
good to know in prod ;)
2013-08-21 19:48:47 -07:00
TJ Holowaychuk
2de010ca47
add err.status support. Closes #20
2013-08-21 19:47:56 -07:00
TJ Holowaychuk
ca7be7b89f
add Context#cookies support. Closes #7
...
need to add signing support in there as well
2013-08-20 21:51:14 -07:00
TJ Holowaychuk
607f2fda8f
docs
2013-08-18 11:15:22 -07:00
TJ Holowaychuk
8ccfc14e88
add createContext()
2013-08-18 11:14:01 -07:00
Jonathan Ong
978f581099
app.context: extend the context with your own properties
2013-08-17 16:58:53 -07:00
TJ Holowaychuk
9e167c5ed9
Initial commit
2013-08-17 00:15:57 -07:00