Assignment 2
Due Date: 2019-10-17
Available Points: 20
This assignment builds on top of the previous one and primarily focuses on conditionals and redirections with support for both long-lived and pipelined connections.Additional Methods
- No new methods
Additional Status Codes
301
Moved Permanently (If/foo
is a directory, the server should301
redirect to/foo/
)302
Found (Respect mappings and status codes from a regular expressions-based redirection configuration file)304
Not Modified408
Request Timeout412
Precondition Failed
Additional Request Headers
Connection: close
(It is now optional; its absence means the request islong-lived
)If-Modified-Since
If-Unmodified-Since
If-Match
If-None-Match
Additional Response Headers
ETag
(Only compute “strong”ETags
, come up with your own method)Location
Notes
- Support both
long-lived
andpipelined
connections - Use a default of
5 seconds
for timeouts (specify in a config file) - Any
GET
method that does not result in a2xx
response codeMUST
have atext/html
entity generated by the server explaining the response code (unless prohibited, like304
) - 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 and files (they should be clickable, with dates, sizes, etc.) - Create a separate config file that supports redirections of the form:
# Status: Incoming RegExp Redirect URI
302: ^(.*)/coolcar.html$ $1/galaxie.html
302: ^/a2-test/(.*)/1\.[234]/(.*) /a2-test/$1/1.1/$2
301: ^(.*)/mercury/(.*)$ $1/ford/$2
Submission and Evaluation
- Extract sample test files tarball into your web server’s document root
- Place your
Dockerfile
at the root of your repository (not inside of a nested folder) - Make your
Dockerfile
run your server on port80
by default - Release your implementation with the
a2
tag - Submissions will be evaluated using a variation of
cs531a2
test suite from our testing service and some manual inspection of responses and source code (if necessary) - Tests will be performed based on the contents and structure of the
a2-test
folder of the sample test files - One point will be awarded for passing test cases of each of the previous assignments (except certain test cases where there are obvious backward compatibility conflicts)