Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Added no cache to SSE #26

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public final void handle(final SimpleHttpExchange exchange) throws IOException{
exchange.getResponseHeaders().add("Access-Control-Allow-Origin", exchange.getRequestHeaders().getFirst("origin"));
exchange.getResponseHeaders().add("Access-Control-Allow-Methods","GET, HEAD, POST, PUT, DELETE");
exchange.getResponseHeaders().add("Access-Control-Max-Age", String.valueOf(TimeUnit.HOURS.toSeconds(1)));
exchange.getResponseHeaders().add("Cache-Control","no-cache");

if(exchange.getRequestMethod() == RequestMethod.OPTIONS){
exchange.sendResponseHeaders(HttpCode.HTTP_OK,0);
Expand Down