Spray: Bringing RequestContext in scope results in timeout

Viewed 1522

Hi scala and spray people!

I have a small annoying issue with extracting the HTTP 'Accept' header from the RequestContext and matching on it. On a normal route like so:

get {
  respondWithMediaType(`text/plain`) {
    complete ( "Hello World!" )
  }
}

It works like a charm. But whenever I bring the context into scope like so (as suggested in the documentation for directives):

get { context => {
  respondWithMediaType(`text/plain`) {
    complete ( "Hello World!" )
  }
} }

The result becomes the following error message:

The server was not able to produce a timely response to your request.

I am fairly new to Spray, but it looks really odd to me that bringing an (otherwise implicit) object into scope can have such a weird sideeffect. Does any of you have a clue on what is going on?

1 Answers
Related