75 lines
2.9 KiB
Plaintext
75 lines
2.9 KiB
Plaintext
In Racket 5.0.99.4 and before, the Web Server supported implicit
|
|
conversion of X-expressions and lists with the format (cons/c bytes?
|
|
(listof (or/c string? bytes?))) into response data structures for output.
|
|
|
|
After 5.0.99.4, this implicit conversion has been generalized into
|
|
current-response/c and response/c. In the process, implicit conversion
|
|
has been completely removed from some internal plumbing AND the
|
|
response structures have been streamlined---primarily for efficiency.
|
|
|
|
This document describes the incompatible changes and how to restore
|
|
the old behavior when that is possible.
|
|
|
|
--- Coercion behavior ---
|
|
|
|
The old coercion behavior will be dynamically introduced by requiring
|
|
web-server/compat/0/coerce or parameterizing current-response/c to
|
|
(coerce/c normalize-response) after requiring
|
|
web-server/compat/0/http/response-structs.
|
|
|
|
--- New response structures ---
|
|
|
|
The http/response-structs module has changed to be almost
|
|
unrecognizable. http/response-structs was provided through http and
|
|
servlet, so many Web applications implicitly rely on it.
|
|
|
|
web-server/compat/0/http/response-structs provides a version that
|
|
implements the old behavior without interferring with new version
|
|
(i.e., they can both be required simultaneously.) [N.B. response/port
|
|
was only present for a few weeks, so it is not provided in the
|
|
compatibility library.]
|
|
|
|
--- xexpr-response/cookies ---
|
|
|
|
The http/cookie module provided xexpr-response/cookies, but that
|
|
functionality is now part of response/xexpr. The old function can be
|
|
required from web-server/compat/0/http/cookie (without interferring
|
|
with any other bindings from the new cookie module.)
|
|
|
|
--- Internal APIs ---
|
|
|
|
Many internal APIs are restricted to receive only actual response?
|
|
structures:
|
|
|
|
configuration-table responders
|
|
authentication responder on dispatchers/dispatch-passwords
|
|
dispatchers/dispatch-lift --- make
|
|
dispatchers/dispatch-pathprocedure --- make
|
|
http/response --- output-response and output-response/method
|
|
|
|
No compatible interface is provided for these functions and data structures.
|
|
|
|
--- External APIs ---
|
|
|
|
Most external APIs now use the new response/c. Specifically:
|
|
|
|
dispatch/serve --- serve/dispatch
|
|
servlet-dispatch --- dispatch/servlet
|
|
servlet-env --- serve/servlet
|
|
servlet/web --- send/*, with-errors-to-browser
|
|
dispatchers/dispatch-servlets --- servlet-loading responder argument
|
|
#lang web-server/insta
|
|
lang/web --- make-stateless-servlet
|
|
private/servlet --- handler field
|
|
serlet/servlet-structs --- response-generator/c, expiration-handler/c
|
|
servlet/setup --- make*servlet
|
|
|
|
These represent nearly every place where servlets typically interact
|
|
with the server.
|
|
|
|
However, one function: send/formlet from formlets used to allow any
|
|
old response/c as a wrapper result, while the new version requires
|
|
that the wrapper returns an Xexpr. This changes is justified in that
|
|
formlets already bake in support for Xexpr as a fundamental part of
|
|
their syntax.
|