Skip to content

Commit

Permalink
add-no-store-instruction-header: Add no store instruction for cache h…
Browse files Browse the repository at this point in the history
…eader (#49)
  • Loading branch information
papey authored Feb 7, 2025
1 parent 11afe90 commit c121848
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions neurow/integration_test/message_brokering_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule Neurow.IntegrationTest.MessageBrokeringTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand Down Expand Up @@ -91,7 +91,7 @@ defmodule Neurow.IntegrationTest.MessageBrokeringTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand Down
10 changes: 5 additions & 5 deletions neurow/integration_test/message_history_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defmodule Neurow.IntegrationTest.MessageHistoryTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand All @@ -70,7 +70,7 @@ defmodule Neurow.IntegrationTest.MessageHistoryTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
])
Expand Down Expand Up @@ -112,7 +112,7 @@ defmodule Neurow.IntegrationTest.MessageHistoryTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand All @@ -139,7 +139,7 @@ defmodule Neurow.IntegrationTest.MessageHistoryTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand Down Expand Up @@ -171,7 +171,7 @@ defmodule Neurow.IntegrationTest.MessageHistoryTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand Down
4 changes: 2 additions & 2 deletions neurow/integration_test/sse_livecycle_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Neurow.IntegrationTest.SseLifecycleTest do

assert_headers(headers, [
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"}
Expand Down Expand Up @@ -59,7 +59,7 @@ defmodule Neurow.IntegrationTest.SseLifecycleTest do
headers,
[
{"access-control-allow-origin", "*"},
{"cache-control", "no-cache"},
{"cache-control", "no-cache, no-store"},
{"connection", "close"},
{"content-type", "text/event-stream"},
{"transfer-encoding", "chunked"},
Expand Down
2 changes: 1 addition & 1 deletion neurow/lib/neurow/public_api/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Neurow.PublicApi.Endpoint do
conn
|> put_resp_header("content-type", "text/event-stream")
|> put_resp_header("access-control-allow-origin", "*")
|> put_resp_header("cache-control", "no-cache")
|> put_resp_header("cache-control", "no-cache, no-store")
|> put_resp_header("connection", "close")
|> put_resp_header("x-sse-timeout", to_string(timeout_ms))
|> put_resp_header("x-sse-keepalive", to_string(keep_alive_ms))
Expand Down

0 comments on commit c121848

Please sign in to comment.