New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get header deprecation #1412

Merged
merged 2 commits into from Feb 22, 2013
Jump to file or symbol
Failed to load files and symbols.
+14 −14
Diff settings

Always

Just for now

@@ -34,7 +34,7 @@ case class OkResponse() extends LiftResponse with HeaderDefaults {
}
trait HeaderDefaults {
val headers: List[(String, String)] = S.getHeaders(Nil)
val headers: List[(String, String)] = S.getResponseHeaders(Nil)
val cookies: List[HTTPCookie] = S.responseCookies
}
@@ -49,7 +49,7 @@ case class CreatedResponse(xml: Node, mime: String, addlHeaders: List[(String, S
def code = 201
val headers: List[(String, String)] = S.getHeaders(("Content-Type" -> mime) :: addlHeaders)
val headers: List[(String, String)] = S.getResponseHeaders(("Content-Type" -> mime) :: addlHeaders)
def cookies: List[HTTPCookie] = Nil
@@ -237,7 +237,7 @@ case class ServiceUnavailableResponse(retryAfter: Long) extends LiftResponse {
}
object JavaScriptResponse {
def apply(js: JsCmd): LiftResponse = JavaScriptResponse(js, S.getHeaders(Nil), S.responseCookies, 200)
def apply(js: JsCmd): LiftResponse = JavaScriptResponse(js, S.getResponseHeaders(Nil), S.responseCookies, 200)
}
/**
@@ -255,7 +255,7 @@ trait LiftResponse {
}
object JsonResponse {
def headers: List[(String, String)] = S.getHeaders(Nil)
def headers: List[(String, String)] = S.getResponseHeaders(Nil)
def cookies: List[HTTPCookie] = S.responseCookies
def apply(json: JsExp): LiftResponse =
@@ -674,7 +674,7 @@ case class XmlMimeResponse(xml: Node, mime: String, addlHeaders: List[(String, S
def code = 200
val headers: List[(String, String)] = S.getHeaders(("Content-Type" -> mime) :: addlHeaders)
val headers: List[(String, String)] = S.getResponseHeaders(("Content-Type" -> mime) :: addlHeaders)
def cookies: List[HTTPCookie] = Nil
@@ -685,7 +685,7 @@ class XmlResponse(val xml: Node, val code: Int, val mime: String, val cookies: L
val addlHeaders: List[(String, String)] = XmlResponse.addlHeaders) extends XmlNodeResponse {
def docType = Empty
val headers: List[(String, String)] = S.getHeaders(("Content-Type" -> mime) :: addlHeaders)
val headers: List[(String, String)] = S.getResponseHeaders(("Content-Type" -> mime) :: addlHeaders)
def out: Node = xml
}
@@ -758,7 +758,7 @@ case class AtomResponse(xml: Node, addlHeaders: List[(String, String)] = XmlResp
def code = 200
val headers: List[(String, String)] = S.getHeaders(("Content-Type" -> "application/atom+xml; charset=utf-8") :: addlHeaders)
val headers: List[(String, String)] = S.getResponseHeaders(("Content-Type" -> "application/atom+xml; charset=utf-8") :: addlHeaders)
def cookies: List[HTTPCookie] = Nil
@@ -773,7 +773,7 @@ case class OpenSearchResponse(xml: Node, addlHeaders: List[(String, String)] = X
def code = 200
val headers: List[(String, String)] = S.getHeaders(("Content-Type" -> "application/opensearchdescription+xml; charset=utf-8") ::
val headers: List[(String, String)] = S.getResponseHeaders(("Content-Type" -> "application/opensearchdescription+xml; charset=utf-8") ::
addlHeaders)
def cookies: List[HTTPCookie] = Nil
@@ -1117,7 +1117,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
notices = Nil
// Phase 3: Response conversion including fixHtml
LiftRules.convertResponse((xml, overrideResponseCode.is openOr code),
S.getHeaders(LiftRules.defaultHeaders((xml, request))),
S.getResponseHeaders(LiftRules.defaultHeaders((xml, request))),
S.responseCookies,
request)
}
@@ -1079,7 +1079,7 @@ class Req(val path: ParsePath,
case NotFoundAsTemplate(path) => notFoundViaTemplate(path)
case NotFoundAsResponse(resp) => resp
case NotFoundAsNode(node) => LiftRules.convertResponse((node, 404),
S.getHeaders(LiftRules.defaultHeaders((node, this))),
S.getResponseHeaders(LiftRules.defaultHeaders((node, this))),
S.responseCookies,
this)
}
@@ -1090,7 +1090,7 @@ class Req(val path: ParsePath,
case NotFoundAsTemplate(path) => notFoundViaTemplate(path)
case NotFoundAsResponse(resp) => resp
case NotFoundAsNode(node) => LiftRules.convertResponse((node, 404),
S.getHeaders(LiftRules.defaultHeaders((node, this))),
S.getResponseHeaders(LiftRules.defaultHeaders((node, this))),
S.responseCookies,
this)
}
@@ -1115,7 +1115,7 @@ class Req(val path: ParsePath,
f(path)
}
case NotFoundAsNode(node) => Full(LiftRules.convertResponse((node, 404),
S.getHeaders(LiftRules.defaultHeaders((node, this))),
S.getResponseHeaders(LiftRules.defaultHeaders((node, this))),
S.responseCookies,
this))
}
@@ -1491,7 +1491,7 @@ trait S extends HasParams with Loggable {
}
@deprecated("2.5", "Use S.getResponseHeaders instead for clarity.")
@deprecated("Use S.getResponseHeaders instead for clarity.", "2.5")
def getHeaders(in: List[(String, String)]): List[(String, String)] = {
getResponseHeaders(in)
}
@@ -1513,7 +1513,7 @@ trait S extends HasParams with Loggable {
).openOr(Nil)
}
@deprecated("2.5", "Use S.getResponseHeader instead for clarity.")
@deprecated("Use S.getResponseHeader instead for clarity.", "2.5")
def getHeader(name: String): Box[String] = {
getResponseHeader(name)
}
ProTip! Use n and p to navigate between commits in a pull request.