File tree Expand file tree Collapse file tree
http-core/src/main/scala/org/apache/pekko/http/impl
http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,12 +76,9 @@ private[http2] final class HeaderDecompression(masterHeaderParser: HttpHeaderPar
7676 }
7777
7878 name match {
79- case " content-type" => handle(ContentType .parse(name, value, parserSettings))
80- case " :authority" => handle(Authority .parse(name, value, parserSettings))
81- case " :path" =>
82- if (value.isEmpty)
83- throw new Http2ProtocolException (" Malformed request: ':path' must not be empty" )
84- handle(PathAndQuery .parse(name, value, parserSettings))
79+ case " content-type" => handle(ContentType .parse(name, value, parserSettings))
80+ case " :authority" => handle(Authority .parse(name, value, parserSettings))
81+ case " :path" => handle(PathAndQuery .parse(name, value, parserSettings))
8582 case " :method" => handle(Method .parse(name, value, parserSettings))
8683 case " :scheme" => handle(Scheme .parse(name, value, parserSettings))
8784 case " content-length" => handle(ContentLength .parse(name, value, parserSettings))
Original file line number Diff line number Diff line change @@ -351,7 +351,8 @@ private[http] final class UriParser(
351351 // https://tools.ietf.org/html/rfc7540#section-8.1.2.3
352352 def `http2-path-pseudo-header` = rule(
353353 `absolute-path` ~ optional('?' ~ rawQueryString) // origin-form
354- ) // TODO: asterisk-form
354+ | '*' ~ run(setPath(Path .Empty )) ~ run { _rawQueryString = None } // asterisk-form (for OPTIONS requests)
355+ )
355356
356357 /**
357358 * @return path and percent-encoded query string. When in in 'relaxed' mode, characters not permitted by https://tools.ietf.org/html/rfc3986#section-3.4
Original file line number Diff line number Diff line change @@ -449,13 +449,15 @@ class RequestParsingSpec extends PekkoSpecWithMaterializer with Inside with Insp
449449 // ... A request in asterisk form includes the
450450 // value '*' for the ":path" pseudo-header field.
451451
452- " handle a ':path' with an asterisk" in pendingUntilFixed {
452+ " handle a ':path' with an asterisk" in {
453453 val request : HttpRequest = parseExpectOk(
454454 keyValuePairs = Vector (
455455 " :method" -> " OPTIONS" ,
456456 " :scheme" -> " http" ,
457- " :path" -> " *" ))
458- request.uri.toString should === (" *" ) // FIXME: Compare in a better way
457+ " :path" -> " *"
458+ ))
459+ request.uri.path.toString should === (" " )
460+ request.uri.rawQueryString should === (None )
459461 }
460462
461463 // [The ":path"] pseudo-header field MUST NOT be empty for "http" or "https"
You can’t perform that action at this time.
0 commit comments