ring-clojure/ring — pull request #30 by rwfowler (2012-11-15 17:35:22+00:00)
Title: Set default content-length to -1

We were having `NullPointerException` trouble when handling chunked file uploads due to the fact that `:content-length` was missing from the request. This patch defaults [RequestContext.getContentLength()](http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/RequestContext.html#getContentLength\(\)) to -1 which is what [ServletRequest.getContentLength()](http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getContentLength\(\)) does.

Here's the interesting part of the stacktrace we were getting in case you're interested:
```
java.lang.NullPointerException
at ring.middleware.multipart_params$request_context$reify__4928.getContentLength(multipart_params.clj:23)
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.(FileUploadBase.java:936)
at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
at ring.middleware.multipart_params$file_item_seq.invoke(multipart_params.clj:38)
at ring.middleware.multipart_params$parse_multipart_params.invoke(multipart_params.clj:54)
at ring.middleware.multipart_params$wrap_multipart_params$fn__4948.invoke(multipart_params.clj:98)
at ring.middleware.params$wrap_params$fn__4844.invoke(params.clj:55)
```