static middleware causes an unknown error for long URLs #609

Closed
ghost opened this Issue Jun 26, 2012 · 3 comments

2 participants

@ghost

This tiny server will return a 500: unknown error when given a URL longer than 255 bytes:

connect = require('connect');
var app = connect()
  .use(connect.logger('dev'))
  .use(connect.static('public'))
  .use(function(req, res){
    res.end('hello world\n');
  })
 .listen(3000);

// this will work (255 a's):
// http://localhost:3000/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

// this will trigger an unknown error (256 a's):
// http://localhost:3000/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Removing the static middleware will make long URLs work, however.

@tj
Sencha Labs member
tj commented Jun 26, 2012

on an ENAMETOOLONG it should just pass control to the next middleware. which version(s)? perhaps you're using an older version without this fix

@ghost

node 0.6.7
connect 2.3.4

About to try upgrading node?

@ghost

Ah, I see where that is. More debugging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment