| 77 | } |
| 78 | |
| 79 | void onFile(HttpRequest& request, HttpResponse& response) |
| 80 | { |
| 81 | if(lastModified.length() > 0 && request.headers[HTTP_HEADER_IF_MODIFIED_SINCE] == lastModified) { |
| 82 | response.code = HTTP_STATUS_NOT_MODIFIED; |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | String file = request.uri.getRelativePath(); |
| 87 | |
| 88 | if(file[0] == '.') { |
| 89 | response.code = HTTP_STATUS_FORBIDDEN; |
| 90 | } else { |
| 91 | if(lastModified.length() > 0) { |
| 92 | response.headers[HTTP_HEADER_LAST_MODIFIED] = lastModified; |
| 93 | } |
| 94 | |
| 95 | response.setCache(86400, true); // It's important to use cache for better performance. |
| 96 | response.sendFile(file); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | void onAjaxNetworkList(HttpRequest& request, HttpResponse& response) |
| 101 | { |
nothing calls this directly
no test coverage detected