Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds check for date header and value #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
|get |/partial_content.txt |range start |0 |range end|4 |
|ensure |response code equals |206 |
|ensure |body has partial file contents|public/partial_content.txt|from|0 |to|4 |
|ensure |response has date |
|get |/partial_content.txt |range start | |range end|6 |
|ensure |response code equals |206 |
|ensure |body has partial file contents|public/partial_content.txt|from|71 |to|76|
|get |/partial_content.txt |range start |4 |range end| |
|ensure |response code equals |206 |
|ensure |body has partial file contents|public/partial_content.txt|from|4 |to|76|
|ensure |response has date |
5 changes: 5 additions & 0 deletions src/main/java/HttpBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,9 @@ private void storeResponseInfoFrom(HttpResponse response) throws IOException {
private String latestResponseContentAsString() {
return new String(latestResponseContent);
}

public boolean responseHasDate() {
Header responseDate = response.getFirstHeader(HttpHeaders.DATE);
return (responseDate != null) && !("".equals(responseDate.getValue()));
}
}