<div dir="ltr">Ah, shoulda checked here first, sorry - there's a "mapHeaders" method in wai-util:<div><a href="https://github.com/singpolyma/wai-util/blob/master/Network/Wai/Util.hs#L90">https://github.com/singpolyma/wai-util/blob/master/Network/Wai/Util.hs#L90</a><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 12:37 AM, Leif Warner <span dir="ltr"><<a href="mailto:abimelech@gmail.com" target="_blank">abimelech@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
<span class="HOEnZb"><font color="#888888"><div>
<br></div><div>-Leif</div></font></span></div>
</blockquote></div><br></div>