comparison src/luan/webserver/handlers/IndexHandler.java @ 1167:7e6f28c769a1

better handlers
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 08 Feb 2018 19:06:31 -0700
parents c123ee15f99b
children
comparison
equal deleted inserted replaced
1166:7ef40e1923b7 1167:7e6f28c769a1
21 public Response handle(Request request) { 21 public Response handle(Request request) {
22 if( request.path.endsWith("/") ) { 22 if( request.path.endsWith("/") ) {
23 String path = request.path; 23 String path = request.path;
24 try { 24 try {
25 request.path += indexName; 25 request.path += indexName;
26 Response response = handler.handle(request); 26 return handler.handle(request);
27 if( response != null )
28 return response;
29 } finally { 27 } finally {
30 request.path = path; 28 request.path = path;
31 } 29 }
32 } 30 } else
33 return handler.handle(request); 31 return handler.handle(request);
34 } 32 }
35 } 33 }