Assignment 2
Due Date: 2022-10-19
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
301Moved Permanently (If/foois a directory, the server should301redirect to/foo/)302Found (Respect mappings and status codes from a regular expressions-based redirection configuration file)304Not Modified408Request Timeout412Precondition Failed
Additional Request Headers
Connection: close(It is now optional; its absence means the request islong-lived)If-Modified-SinceIf-Unmodified-SinceIf-MatchIf-None-Match
Additional Response Headers
ETag(Only compute “strong”ETags, come up with your own method)Location
Notes
- Support both
long-livedandpipelinedconnections - Use a default of
5 secondsfor timeouts (specify in a config file) - Any
GETmethod that does not result in a2xxresponse codeMUSThave atext/htmlentity generated by the server explaining the response code (unless prohibited, like304) - In a config file, specify that
index.htmlis 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
Dockerfileat the root of your repository (not inside of a nested folder) - Make your
Dockerfilerun your server on port80by default - Release your implementation with the
a2tag - Submissions will be evaluated using a variation of
cs531a2test 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-testfolder 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)