File tree Expand file tree Collapse file tree 3 files changed +1
-6
lines changed
avaje-jex-static-content/src/main/java/io/avaje/jex/staticcontent
avaje-jex/src/main/java/io/avaje/jex/core Expand file tree Collapse file tree 3 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,10 @@ protected String getExt(String path) {
5959
6060 protected String lookupMime (String path ) {
6161 var lower = path .toLowerCase ();
62-
6362 return Objects .requireNonNullElseGet (
6463 MIME_MAP .getContentTypeFor (path ),
6564 () -> {
6665 String ext = getExt (lower );
67-
6866 return mimeTypes .getOrDefault (ext , "application/octet-stream" );
6967 });
7068 }
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ static StaticResourceHandlerBuilder builder(String root) {
3838
3939 @ Override
4040 public void add (Routing routing ) {
41-
4241 routing .get (path , createHandler ());
4342 }
4443
@@ -122,7 +121,6 @@ private StaticFileHandler fileLoader() {
122121 if (directoryIndex != null ) {
123122 try {
124123 dirIndex = new File (root .transform (this ::appendSlash ) + directoryIndex ).getCanonicalFile ();
125-
126124 fsRoot = dirIndex .getParentFile ().getPath ();
127125 } catch (Exception e ) {
128126 throw new IllegalStateException (
@@ -131,7 +129,6 @@ private StaticFileHandler fileLoader() {
131129 } else {
132130 try {
133131 singleFile = new File (root ).getCanonicalFile ();
134-
135132 fsRoot = singleFile .getParentFile ().getPath ();
136133 } catch (Exception e ) {
137134 throw new IllegalStateException (FAILED_TO_LOCATE_FILE + root , e );
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ public String pathParam(String name) {
250250 @ Override
251251 public String queryParam (String name ) {
252252 final List <String > vals = queryParams (name );
253- return vals == null || vals .isEmpty () ? null : vals .getFirst ();
253+ return vals .isEmpty () ? null : vals .getFirst ();
254254 }
255255
256256 private Map <String , List <String >> queryParams () {
You can’t perform that action at this time.
0 commit comments