Skip to content

Commit

Permalink
Allows Sec-WebSocket-Extensions in requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ignasi35 authored and ktoso committed Mar 22, 2018
1 parent eb1ef78 commit 4cf5672
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ private[http] object `Sec-WebSocket-Extensions` extends ModeledCompanion[`Sec-We
*/
@InternalApi
private[http] final case class `Sec-WebSocket-Extensions`(extensions: immutable.Seq[WebSocketExtension])
extends ResponseHeader {
extends RequestResponseHeader {
require(extensions.nonEmpty, "Sec-WebSocket-Extensions.extensions must not be empty")
import `Sec-WebSocket-Extensions`.extensionsRenderer
protected[http] def renderValue[R <: Rendering](r: R): r.type = r ~~ extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package akka.http.scaladsl.model.headers
import akka.http.impl.util._
import org.scalatest._
import java.net.InetAddress
import akka.http.scaladsl.model._

import akka.http.scaladsl.model.{ headers, _ }

class HeaderSpec extends FreeSpec with Matchers {
"ModeledCompanion should" - {
Expand Down Expand Up @@ -132,6 +133,7 @@ class HeaderSpec extends FreeSpec with Matchers {
`Proxy-Authorization`(BasicHttpCredentials("johan", "correcthorsebatterystaple")),
Range(RangeUnits.Bytes, Vector(ByteRange(1, 1024))),
Referer(Uri("http://example.com/")),
`Sec-WebSocket-Extensions`(Vector(WebSocketExtension("permessage-deflate"), WebSocketExtension("client_max_window_bits"))),
`Sec-WebSocket-Protocol`(Vector("chat", "superchat")),
`Sec-WebSocket-Key`("dGhlIHNhbXBsZSBub25jZQ"),
`Sec-WebSocket-Version`(Vector(13)),
Expand Down

0 comments on commit 4cf5672

Please sign in to comment.