From 1422c4cf6454934b53606f83f2665252f5603a8b Mon Sep 17 00:00:00 2001 From: Jem Mawson Date: Sat, 19 Jan 2019 17:42:29 +1000 Subject: [PATCH] move SSE Setting classes and config from core to base --- .../src/main/resources/reference.conf | 9 -- akka-http/src/main/resources/reference.conf | 93 +++++++++++-------- .../ServerSentEventSettingsImpl.scala | 0 .../settings/ServerSentEventSettings.scala | 0 .../settings/ServerSentEventSettings.scala | 0 5 files changed, 52 insertions(+), 50 deletions(-) rename {akka-http-core => akka-http}/src/main/scala/akka/http/impl/settings/ServerSentEventSettingsImpl.scala (100%) rename {akka-http-core => akka-http}/src/main/scala/akka/http/javadsl/settings/ServerSentEventSettings.scala (100%) rename {akka-http-core => akka-http}/src/main/scala/akka/http/scaladsl/settings/ServerSentEventSettings.scala (100%) diff --git a/akka-http-core/src/main/resources/reference.conf b/akka-http-core/src/main/resources/reference.conf index 5261d589f79..e042ca1cfb6 100644 --- a/akka-http-core/src/main/resources/reference.conf +++ b/akka-http-core/src/main/resources/reference.conf @@ -520,13 +520,4 @@ akka.http { # HttpResponse on client side). tls-session-info-header = off } - - # server-sent events - sse { - # The maximum size for parsing server-sent events. - max-event-size = 8192 - - # The maximum size for parsing lines of a server-sent event. - max-line-size = 4096 - } } diff --git a/akka-http/src/main/resources/reference.conf b/akka-http/src/main/resources/reference.conf index 86a5eab81ea..3c9f2a92ed0 100644 --- a/akka-http/src/main/resources/reference.conf +++ b/akka-http/src/main/resources/reference.conf @@ -5,44 +5,55 @@ # This is the reference config file that contains all the default settings. # Make your edits/overrides in your application.conf. -akka.http.routing { - # Enables/disables the returning of more detailed error messages to the - # client in the error response - # Should be disabled for browser-facing APIs due to the risk of XSS attacks - # and (probably) enabled for internal or non-browser APIs - # (Note that akka-http will always produce log messages containing the full error details) - verbose-error-messages = off - - # Enables/disables ETag and `If-Modified-Since` support for FileAndResourceDirectives - file-get-conditional = on - - # Enables/disables the rendering of the "rendered by" footer in directory listings - render-vanity-footer = yes - - # The maximum size between two requested ranges. Ranges with less space in between will be coalesced. - # - # When multiple ranges are requested, a server may coalesce any of the ranges that overlap or that are separated - # by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the - # corresponding byte-range-spec appeared in the received Range header field. Since the typical overhead between - # parts of a multipart/byteranges payload is around 80 bytes, depending on the selected representation's - # media type and the chosen boundary parameter length, it can be less efficient to transfer many small - # disjoint parts than it is to transfer the entire selected representation. - range-coalescing-threshold = 80 - - # The maximum number of allowed ranges per request. - # Requests with more ranges will be rejected due to DOS suspicion. - range-count-limit = 16 - - # The maximum number of bytes per ByteString a decoding directive will produce - # for an entity data stream. - decode-max-bytes-per-chunk = 1m - - # Maximum content length after applying a decoding directive. When the directive - # decompresses, for example, an entity compressed with gzip, the resulting stream can be much - # larger than the max-content-length. Like with max-content-length, this is not necessarilly a - # problem when consuming the entity in a streaming fashion, but does risk high memory use - # when the entity is made strict or marshalled into an in-memory object. - # This limit (like max-content-length) can be overridden on a case-by-case basis using the - # withSizeLimit directive. - decode-max-size = 8m -} +akka.http { + routing { + # Enables/disables the returning of more detailed error messages to the + # client in the error response + # Should be disabled for browser-facing APIs due to the risk of XSS attacks + # and (probably) enabled for internal or non-browser APIs + # (Note that akka-http will always produce log messages containing the full error details) + verbose-error-messages = off + + # Enables/disables ETag and `If-Modified-Since` support for FileAndResourceDirectives + file-get-conditional = on + + # Enables/disables the rendering of the "rendered by" footer in directory listings + render-vanity-footer = yes + + # The maximum size between two requested ranges. Ranges with less space in between will be coalesced. + # + # When multiple ranges are requested, a server may coalesce any of the ranges that overlap or that are separated + # by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the + # corresponding byte-range-spec appeared in the received Range header field. Since the typical overhead between + # parts of a multipart/byteranges payload is around 80 bytes, depending on the selected representation's + # media type and the chosen boundary parameter length, it can be less efficient to transfer many small + # disjoint parts than it is to transfer the entire selected representation. + range-coalescing-threshold = 80 + + # The maximum number of allowed ranges per request. + # Requests with more ranges will be rejected due to DOS suspicion. + range-count-limit = 16 + + # The maximum number of bytes per ByteString a decoding directive will produce + # for an entity data stream. + decode-max-bytes-per-chunk = 1m + + # Maximum content length after applying a decoding directive. When the directive + # decompresses, for example, an entity compressed with gzip, the resulting stream can be much + # larger than the max-content-length. Like with max-content-length, this is not necessarilly a + # problem when consuming the entity in a streaming fashion, but does risk high memory use + # when the entity is made strict or marshalled into an in-memory object. + # This limit (like max-content-length) can be overridden on a case-by-case basis using the + # withSizeLimit directive. + decode-max-size = 8m + } + + # server-sent events + sse { + # The maximum size for parsing server-sent events. + max-event-size = 8192 + + # The maximum size for parsing lines of a server-sent event. + max-line-size = 4096 + } +} \ No newline at end of file diff --git a/akka-http-core/src/main/scala/akka/http/impl/settings/ServerSentEventSettingsImpl.scala b/akka-http/src/main/scala/akka/http/impl/settings/ServerSentEventSettingsImpl.scala similarity index 100% rename from akka-http-core/src/main/scala/akka/http/impl/settings/ServerSentEventSettingsImpl.scala rename to akka-http/src/main/scala/akka/http/impl/settings/ServerSentEventSettingsImpl.scala diff --git a/akka-http-core/src/main/scala/akka/http/javadsl/settings/ServerSentEventSettings.scala b/akka-http/src/main/scala/akka/http/javadsl/settings/ServerSentEventSettings.scala similarity index 100% rename from akka-http-core/src/main/scala/akka/http/javadsl/settings/ServerSentEventSettings.scala rename to akka-http/src/main/scala/akka/http/javadsl/settings/ServerSentEventSettings.scala diff --git a/akka-http-core/src/main/scala/akka/http/scaladsl/settings/ServerSentEventSettings.scala b/akka-http/src/main/scala/akka/http/scaladsl/settings/ServerSentEventSettings.scala similarity index 100% rename from akka-http-core/src/main/scala/akka/http/scaladsl/settings/ServerSentEventSettings.scala rename to akka-http/src/main/scala/akka/http/scaladsl/settings/ServerSentEventSettings.scala