senchalabs/connect — pull request #647 by dambalah (2012-08-21 20:47:15+00:00)
Title: basicAuth middleware should return 400 HTTP status code when authorization header is malformed

The basicAuth middleware was throwing a 500 error when somebody passed in a malformed Authorization HTTP header such as:

```
Authorization: invalid
```

or

```
Authorization: Digest gasdga
```

This patch fixes this issue and returns an HTTP 400 (BAD REQUEST) for these cases.