weavejester/compojure — Issue #46: Static files with space characters aren't routed properly
Author: gberenfield
Created: 2011-12-16 02:30:05+00:00
State: open

I first ran into this in [noir](https://github.com/ibdknox/noir) which has [Issue #36](https://github.com/ibdknox/noir/issues/36) filed against this.

I suspected an upstream bug so created a new compojure app using the wiki example. I placed a pdf in "resources/public/file.pdf" which is found and parsed correctly but "resources/public/spaced%20file.pdf" (in the url) is not.

```
2011-12-15 21:15:37.305:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
Started server on port 3000
2011-12-15 21:15:37.306:INFO::jetty-6.1.26
2011-12-15 21:15:37.322:INFO::Started SocketConnector@0.0.0.0:3000
2011-12-15 21:16:05.110:WARN::/2011-11-11%20gas.pdf
java.io.FileNotFoundException: /Users/gberenfield/clojure/web/resources/public/spaced%20file.pdf (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at ring.util.servlet$set_body.invoke(servlet.clj:78)
at ring.util.servlet$update_servlet_response.invoke(servlet.clj:108)
at ring.adapter.jetty$proxy_handler$fn__77.invoke(jetty.clj:18)
at ring.adapter.jetty.proxy$org.mortbay.jetty.handler.AbstractHandler$0.handle(Unknown Source)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
```