Content Aware Server Responses
WebSEAL supports the ability to use different response template pages for different content types. It also provides the ability to specify custom HTTP response codes for different generated responses.
<file identifier>{.<response_code>}.<mime sub-type>| Filename | Description |
|---|---|
| login.html |
This file is returned for requests with the 'HTML' MIME sub-type. For example, text/html. The default login response code is used. |
| login.json |
This file is returned for requests with the ‘json’ MIME sub-type. For example, application/json. The default login response code is used. |
| login.401.json |
This file is returned for requests with the ‘json’ MIME sub-type. For example, application/json. The 401 HTTP response code is returned. |
- Locating the MIME sub-type in the ‘accept’ HTTP header of the request. It uses the first MIME entry that is found in the ‘accept’ header disregarding any specified quality factor and any subsequent MIME types;
- If the ‘accept’ HTTP header is not present it locates the MIME sub-type from the ‘content-type’ HTTP header in the request;
- If both headers are missing from the request it uses the content-type as defined by the ‘default-response-type’ configuration entry within the [acnt-mgt] stanza of the configuration file. See [acnt-mgt] stanza.
Once the correct content type is determined, WebSEAL searches for a matching file in the appropriate directory, as determined by the locale and junction. See Junction-specific static server response pages. If no matching file for the requested response type is located the appropriate directories are then searched for a file that matches the default content type, as defined by the ‘default-response-type’ configuration entry.
By default WebSEAL sends a 302 response when a redirect is required, along with the 38cf0421.html error page. This error page can be customized with different response codes for different response types if a 302 response is not desired.
WebSEAL provides two out-of-the-box
(OOTB) JSON response files: management/C/default.json and
errors/C/default.500.json. If you want to revert to the legacy WebSEAL behaviour of returning HTML files for all
responses, delete these two response files from the management root of your WebSEAL instance.