File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -167,18 +167,6 @@ impl Handler for MainHandler {
167
167
}
168
168
}
169
169
170
- fn pass_iron_errors_with_redirect ( e : IronError ) -> IronResult < Response > {
171
- // in some cases the iron router will return a redirect as an `IronError`.
172
- // Here we convert these into an `Ok(Response)`.
173
- if e. error . downcast_ref :: < TrailingSlash > ( ) . is_some ( )
174
- || e. response . status == Some ( status:: MovedPermanently )
175
- {
176
- Ok ( e. response )
177
- } else {
178
- Err ( e)
179
- }
180
- }
181
-
182
170
// This is kind of a mess.
183
171
//
184
172
// Almost all files should be served through the `router_handler`; eventually
@@ -195,7 +183,17 @@ impl Handler for MainHandler {
195
183
self . shared_resource_handler
196
184
. handle ( req)
197
185
. or_else ( |e| if_404 ( e, || self . router_handler . handle ( req) ) )
198
- . or_else ( pass_iron_errors_with_redirect)
186
+ . or_else ( |e| {
187
+ // in some cases the iron router will return a redirect as an `IronError`.
188
+ // Here we convert these into an `Ok(Response)`.
189
+ if e. error . downcast_ref :: < TrailingSlash > ( ) . is_some ( )
190
+ || e. response . status == Some ( status:: MovedPermanently )
191
+ {
192
+ Ok ( e. response )
193
+ } else {
194
+ Err ( e)
195
+ }
196
+ } )
199
197
. or_else ( |e| {
200
198
let err = if let Some ( err) = e. error . downcast_ref :: < error:: Nope > ( ) {
201
199
* err
You can’t perform that action at this time.
0 commit comments