Skip to content

Commit f746a02

Browse files
committed
wip
1 parent eeeb709 commit f746a02

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

zio-http/shared/src/main/scala/zio/http/endpoint/Endpoint.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,16 @@
1616

1717
package zio.http.endpoint
1818

19-
import scala.annotation.nowarn
20-
import scala.reflect.ClassTag
21-
2219
import zio._
23-
24-
import zio.stream.ZStream
25-
26-
import zio.schema.Schema
27-
2820
import zio.http.Header.Accept.MediaTypeWithQFactor
2921
import zio.http._
3022
import zio.http.codec._
3123
import zio.http.endpoint.Endpoint.{OutErrors, defaultMediaTypes}
24+
import zio.schema.Schema
25+
import zio.stream.ZStream
26+
27+
import scala.annotation.nowarn
28+
import scala.reflect.ClassTag
3229

3330
/**
3431
* An [[zio.http.endpoint.Endpoint]] represents an API endpoint for the HTTP
@@ -389,6 +386,9 @@ final case class Endpoint[PathInput, Input, Err, Output, Auth <: AuthType](
389386
Handler.succeed(Response.unauthorized)
390387
case Some(HttpCodecError.MissingHeader(headerName)) if headerName == Header.Authorization.name =>
391388
Handler.succeed(Response.unauthorized)
389+
case Some(HttpCodecError.DecodingErrorHeader(headerName, error))
390+
if headerName == Header.Authorization.name && error.message == "Header authorization not found" =>
391+
Handler.succeed(Response.unauthorized)
392392
case _: Some[_] =>
393393
Handler.fromFunctionZIO { (request: zio.http.Request) =>
394394
val error = cause.defects.head.asInstanceOf[HttpCodecError]

0 commit comments

Comments
 (0)