comparison src/luan/modules/http/LuanHandler.java @ 1643:8d751af51b9d

fix not_found_hander
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 02 Jan 2022 00:42:58 -0700
parents a37ffe2d1b14
children 5c676385284b
comparison
equal deleted inserted replaced
1642:0a46dbd36208 1643:8d751af51b9d
113 static final String NOT_FOUND = "luan-not-found"; 113 static final String NOT_FOUND = "luan-not-found";
114 114
115 @Override public Response handle(Request request) { 115 @Override public Response handle(Request request) {
116 if( isDisabled ) 116 if( isDisabled )
117 return null; 117 return null;
118 if( request.path.endsWith("/") ) 118 boolean notFound = request.headers.containsKey(NOT_FOUND);
119 if( !notFound && request.path.endsWith("/") )
119 return null; 120 return null;
120 return handle( request, request.headers.containsKey(NOT_FOUND) ); 121 return handle( request, notFound );
121 } 122 }
122 123
123 private Response handle(Request request,boolean notFound) { 124 private Response handle(Request request,boolean notFound) {
124 Thread thread = Thread.currentThread(); 125 Thread thread = Thread.currentThread();
125 String oldName = thread.getName(); 126 String oldName = thread.getName();