Skip to content

Tweaks to Javascript Responses with RestHeloper #1024

Closed
indrajitr opened this Issue May 28, 2011 · 4 comments

3 participants

@indrajitr
Lift Web Framework member

No description provided.

@indrajitr
Lift Web Framework member

This ticket references this conversation in the mailing list:

https://groups.google.com/group/liftweb/browse_thread/thread/14fe3e678380c69c#

Problems:
1. Using JE.Call to construct a JsonP response object results in a JsonResponse. It should be a JavascriptResponse as JsonP is a method call.

  1. The existing JavascriptResponse object returns the content type of "text/javascript". RFC 4329 (http://www.rfc-editor.org/rfc/rfc4329.txt) recommends using "application/javascript" as 'Use of the "text" top-level type for this kind of content is known to be problematic

Proposed solution:
1. RestHelper should implicitly convert JsExp into JavascriptResponses.
See https://github.com/lift/framework/blob/master/web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala#L611

  1. JavascriptResponses should return the Content-Type of "application/javascript" (instead of text/javascript) See https://github.com/lift/framework/blob/master/web/webkit/src/main/scala/net/liftweb/http/LiftResponse.scala#L263

Cheers!

@indrajitr
Lift Web Framework member

Updating tickets (#919, #938, #950, #956, #976, #980, #982, #999, #1008, #1024, #1025, #1032, #1034, #1051)

@dpp
Lift Web Framework member
dpp commented Aug 26, 2011

(In [[r:dd83b199d6ca6a377f4ac24c3ad342a1a378c246]]) Closes #1024 (aka 2^10). Fixed implicit conversions and fixed up some header, etc. stuff on responses

Branch: master

@dpp dpp was assigned Mar 1, 2012
@etorreborre etorreborre pushed a commit to etorreborre/framework that referenced this issue Dec 3, 2014
@dpp dpp Closes #1024 (aka 2^10). Fixed implicit conversions and fixed up some…
… header, etc. stuff on responses
dd83b19
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.