Skip to content

Commit

Permalink
* Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
TiMESPLiNTER committed Jul 10, 2021
1 parent 9b1f868 commit 3f2c8af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package timesplinter.lime.http;

import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

public class HttpInputStream extends FilterInputStream implements HttpInputStreamInterface {
public HttpInputStream(InputStream in) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package timesplinter.lime.http;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

Expand Down
11 changes: 4 additions & 7 deletions lib/src/main/java/timesplinter/lime/router/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ public CompiledRouteInterface match(
})
.filter(route -> Arrays.asList(route.getRouteDefinition().getMethods()).contains(requestMethod))
.findFirst()
.orElseThrow(() -> {
if (!foundPath.get()) {
return new NotFoundRoutingException();
} else {
return new MethodNotAllowedRoutingException();
}
});
.orElseThrow(() -> !foundPath.get()
? new NotFoundRoutingException()
: new MethodNotAllowedRoutingException()
);
}

private CompiledRouteInterface getCachedRoute(RouteInterface route) {
Expand Down

0 comments on commit 3f2c8af

Please sign in to comment.