Assignment 2, CS 431/531, Fall 2018
Due: 2018-10-24
Points available: 20
Additional methods
Additional status codes
- 301 Moved Permanently
- if “/foo” is a directory, the server should 301 redirect to “/foo/”
- 302 Found
- takes a configurable list of regular expressions and provides URIs that the server should 302 redirect to
- 304 Not Modified
- 408 Request Timeout
- 412 Precondition Failed
- Connection: close
- is now optional; its absence means the request is long-lived
- If-Modified-Since
- If-Unmodified-Since
- If-Match
- If-None-Match
Notes
- Support both long-lived and pipelined connections
- Use a default of 15 seconds for timeouts (specify in a config file)
- Only compute “strong” ETags (come up with your own method)
- Any GET method that does not result in a 20X response code MUST have a text/html entity generated by the server explaining the response code (unless prohibited, like 304)
- in a config file, specify that
index.html
is the default resource name for when a URI ends in “/”
- if a directory does not have a default resource (i.e.,
index.html
), then dynamically generate an HTML listing of the directories files (they should be clickable, with dates, sizes, etc.)
- create a separate config file that supports redirections of the form:
#
# Status: Incoming RE Redirect URI
#
302: ^(.*)/coolcar.html$ $1/galaxie.html
302: ^(.*)/1.[234]/(.*) $1/1.1/$2
301: ^(.*)/mercury/(.*)$ $1/ford/$2