Copyright ©2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document is an appendix to Guidelines for Web Content Transformation Proxies [CT-SPEC]. It provides an overview of the test suite for the document. The Working Group has developed this test suite so to have a test case for every testable assertion in the specification.
The Working Group encourages the public and members to contribute tests.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is derived from and is an appendix to Guidelines for Web Content Transformation Proxies [CT-SPEC], which is a draft document, produced by the Content Transformation Task Force of the Mobile Web Best Practices Working Group as part of the Mobile Web Initiative. Please see the "Status of this document" section of the corresponding guidelines specification [CT-SPEC] for complete details about the status of the guidelines version from which this is extracted and which it accompanies.
In particular, this test suite is work in progress and should be regarded as unstable.
Please send comments on this document to the Working Group's public email list public-bpwg-comments@w3.org, a publicly archived mailing list.
This document defines tests for all the normative clauses of the Guidelines for Web Content Transformation Proxies [CT-SPEC]. The normative clauses are presented by order of their topic.
If the HTTP method is altered from HEAD to GET, proxies should (providing such action is in accordance with normal HTTP caching rules) cache the response so that a second GET request for the same content is not required (see also 4.1.4 Serving Cached Responses ).
Other than to convert between HEAD and GET proxies must not alter request methods.
If the request contains a Cache-Control: no-transform
directive, proxies must not alter the request other than to comply with transparent HTTP behavior defined in [RFC 2616 HTTP] sections section 14.9.5 and section 13.5.2 and to add header fields as described in 4.1.6 Additional HTTP Header Fields below.
[...] In this case proxies may for the sake of consistency of representation serve stale data but when doing so should notify the user that this is the case [...]
[...] and must provide a simple means of retrieving a fresh copy.
Other than the modifications required by [RFC 2616 HTTP] proxies should not modify the values of header fields other than theUser-Agent
,Accept
,Accept-Charset
,Accept-Encoding
, andAccept-Language
header fields [...]
[...] and must not delete header fields (see 4.1.5.5 Original Header Fields ).
Other than to comply with transparent HTTP operation, proxies should not modify any request header fields unless one of the following applies: [...]
It is emphasized that requests must not be altered in the presence of Cache-Control: no-transform
as described under 4.1.2 no-transform directive in Request .
[...] Since the concept of "Web site" is not strictly defined, proxies should use heuristics including comparisons of domain name to assess whether resources form part of the same "Web site".
While complying with this section (4.1.5 Alteration of HTTP Header Field Values) and section 4.2.5 Receipt of Vary HTTP Header Field proxies should avoid making repeated requests for the same resource.
A proxy must not reissue a POST request as it is unsafe (see [RFC 2616 HTTP] Section 9.1.1 ).
Proxies must assume that by default users will wish to receive a representation prepared by the Web site.
[...] If a user has made such a choice then proxies may alter header field values when requesting resources in order to reflect that choice, but must, on receipt of an indication from a Web site that it offers alternative representations (see I.1.4.2 Indication of Intended Presentation Media Type of Representation ), inform the user of that and allow them to select an alternative representation.
Proxies must assess whether a user's expressed preference for a restructured representation is still valid if a Web site changes its choice of representations (see 4.2.5 Receipt of Vary HTTP Header Field ).
When requesting resources that are included resources (e.g. style sheets, images), proxies should
make the request for such resources with the same User-Agent
header field as the request for the resource from which they are referenced.
When requesting linked resources that do not form part of the same Web site as the resource from which they are linked, proxies should not base their choice of header fields on a consistency of presentation premise.
When forwarding an HTTP request with altered HTTP header fields, in addition to complying with the rules of normal HTTP operation,
proxies
must include in the request additional fields of the form "X-Device-"<original
header name>
whose values are verbatim copies of the corresponding unaltered header field values, so that it is possible to reconstruct
the original header fields.
Specifically the following mapping must be used: [...]
proxies should add the IP address of the initiator
of the request to the end of a comma separated list in an
X-Forwarded-For
HTTP header field; [...]
proxies must (in accordance with RFC
2616) include a Via
HTTP
header field (see 4.1.6.1 Proxy Treatment of Via Header Field ).
Proxies should indicate their ability to transform content by including a comment in the Via
HTTP header field consisting of the URI "http://www.
When forwarding Via
header fields, proxies should
not alter them by removing comments from them.
In the following, proxies must check for the presence of equivalent <meta http-equiv>
elements in HTML content, if the relevant HTTP header field is not present.
Proxies must provide a means for users to express preferences for inhibiting content transformation even when content transformation has been chosen by the user as the default behavior.
[...] Those preferences must be maintained on a user by user and Web site by Web site basis.
Proxies must solicit re-expression of preferences in respect of a server if the server starts to indicate that it offers varying responses as discussed under 4.2.5 Receipt of Vary HTTP Header Field .
If the response includes a Cache-Control: no-transform
directive
then proxies must not alter it other than to comply with
transparent HTTP behavior as described in [RFC 2616 HTTP] Section 13.5.2 and Section 14.9.5 .
[...] However, if it makes a request with altered header fields in these circumstances, and receives a response containing
a Vary
header field referring to one of the altered
header fields then it should request the resource again with unaltered header fields.
[...] It should also update whatever heuristics it uses so that unaltered header fields are presented first in subsequent requests for this resource.
If the response is an HTML response and it contains a <link
rel="alternate" media="handheld" />
element (and the user agent is determined as being "handheld"), a proxy
should request and process the referenced resource,
unless the resource referenced is the current representation .
If the content is WML proxies should act in a transparent manner.
In the absence of aVary
orno-transform
directive (or ameta HTTP-Equiv
element containingCache-Control: no-transform
) proxies should not transform content matching any of the following rules unless the user has specifically requested transformation: [...]
It must add a Warning 214 Transformation
Applied
HTTP header field; [...]
The altered content should validate according to an appropriate published formal grammar [...]
[...] and if XML must be well-formed ; [...]
It should indicate to the user that the content has been transformed for mobile presentation and provide an option to view the original, unmodified content.
Proxies must not rewrite links when content transformation is prohibited.
Proxies must preserve security between requests for domains that are not same-origin in respect of cookies and scripts.
The practice of intercepting HTTPS links is strongly NOT RECOMMENDED .
If a proxy rewrites HTTPS links, it must advise the user of the security implications of doing so [...]
[...] and must provide the option to bypass it and to communicate with the server directly.
Notwithstanding anything else in this document, proxies must not rewrite HTTPS links in the presence of a Cache-Control: no-transform
directive.
If a proxy rewrites HTTPS links, replacement links
must have the scheme https
.
When forwarding requests originating from HTTPS links proxies must include a Via
header field as discussed under 4.1.6.1 Proxy Treatment of Via Header Field .
When forwarding responses from servers proxies must notify the user of invalid server certificates.
Operators of content transformation proxies should make available an interface through which the functions of the proxy can be exercised.
[...] The operations possible through this interface must cover those necessary to settle the outcome of all conformance statements listed in section B.
The interface must be reachable from terminals with browsing capabilities connected to the Web via a conventional Internet access environment at the tester's premises; [...]
Such access must be granted under fair, reasonable and non-discriminatory conditions.