driver-oss / driver-core

Multi-cloud utilities and service initialization framework.
Apache License 2.0
7 stars 3 forks source link

implicit extension method `responseOrNotFound` duplicates akka-http built-in directives #75

Open stewSquared opened 6 years ago

stewSquared commented 6 years ago

See: https://doc.akka.io/docs/akka-http/10.0.10/scala/http/routing-dsl/directives/misc-directives/rejectEmptyResponse.html#rejectemptyresponse

stewSquared commented 6 years ago

So, our rejection handler needs to handleNotFound if we want this to 404 by default. We should fix this pretty soon, since a few services have started using rejectEmptyResponse, and said rejection ends up manifesting as a CORS issue.

cc @zachdriver @vuspenskiy @jodersky

stewSquared commented 6 years ago

For future reference, we should add customization like this in terms of akka-http directives rather than as extension methods on OptionT

zachdriver commented 6 years ago

I believe it actually is responding with a 404 when using rejectEmptyResponse. The problem is that it's not adding the CORS headers we need, because we're not handling that rejection