You can implement your own response by extending LiftResponse, such
as:
case class RiskyHtmlResponse(text: String, headers: List[(String,
String)], code: Int) extends LiftResponse {
def toResponse = {
val bytes = text.getBytes("UTF-8")
InMemoryResponse(bytes, ("Content-Length",
bytes.length.toString) :: ("Content-Type", "text/html;
charset=utf-8") :: headers, Nil, code)
}
}
Br's,
Marius
On Dec 26, 7:53 am, tommycli <[email protected]> wrote:
> I'm using custom dispatch (to handle both XML & media files). Often, I
> will want to send a page that contains user-inputted (X)HTML. This
> will often be malformed HTML that is nevertheless rendered fine by a
> modern browser.
>
> How would I send this through? I tried PlainTextResponse, but it sends
> the wrong mime type and shows up as well... plaintext. And
> XHtmlResponse requires valid XHTML.
>
> Is there any response that sends a String and "claims" that it's (x)
> html?
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.