iron/static-file — pull request #28 by michaelsproul (2014-08-09 08:07:47+00:00)
Title: (fix) Update for rust-url and Alloy relocation.

I've updated the static file server to use `rust-url` and `Request::alloy`.

Other changes include:

* Using a 301 Permanently Moved redirect instead of a 303 See Other.
* Tests for desired `rust-url` behaviour.
* Gitignore cleanup.

I am now quite familiar with `rust-url`'s internals, so I'll have a go at rewriting the URLish bits of the mounting firmware. It turns out that `url.path()` is always `Some` for [relative schemes like HTTP](https://servo.github.io/rust-url/url/type.SchemeData.html#variant.RelativeSchemeData). There's this other funky thing where `rust-url` ensures that `url.path()` returns a non-empty list. It uses `""` to denote a trailing slash, and treats base urls like `http://example.com` as if they had a trailing slash. This property would be quite useful (read: code-saving), but I've programmed conservatively in case third-party `Middleware` muck around with the URL path. Currently the mounting middleware is guilty of this, although I plan to fix that.