<div dir="ltr"><div>I want to add a session cookie header to the response of staticApp.</div><div><br></div><div>Now, I know that adding a "session" to a static file doesn't make sense.</div><div>I just figured I'd set the session once on the splash page, rather than risk generating multiple sessions for the subsequently fetched "dynamic" resources. (They're actually static files, but per-user copies of the static files.)</div>

<div><br></div><div>I was maybe hoping for something along the lines of:</div><div>do</div><div>  response <- (staticApp $ defaultWebAppSettings ".") request</div><div>  return $ response { responseHeaders = sessionCookie : responseHeaders response }</div>
<div><br></div><div>But that will tell me "`responseHeaders' is not a record selector".</div><div><br></div><div>staticApp returns either ResponseFile, or ResponseBuilder (304 "Not Modified").  I could import Network.Wai.Internal, pattern match on those, and return those w/ the added header.</div>
<div><br></div><div>That seems a bit crufty, though - was hoping someone could suggest a more elegant solution?</div><div><br></div><div>Maybe some Lens or Functor instance across a response's headers, I dunno.</div><div>
<br></div><div>-Leif</div></div>