Skip to content

Commit

Permalink
Update some comments to point at current RFCs (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
swankjesse committed Aug 30, 2017
1 parent 57891fe commit ee5cf50
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions okhttp/src/main/java/okhttp3/CacheControl.java
Expand Up @@ -8,8 +8,7 @@
* A Cache-Control header with cache directives from a server or client. These directives set policy
* on what responses can be stored, and which requests can be satisfied by those stored responses.
*
* <p>See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">RFC 2616,
* 14.9</a>.
* <p>See <a href="https://tools.ietf.org/html/rfc7234#section-5.2">RFC 7234, 5.2</a>.
*/
public final class CacheControl {
/**
Expand Down
4 changes: 2 additions & 2 deletions okhttp/src/main/java/okhttp3/Protocol.java
Expand Up @@ -35,8 +35,8 @@ public enum Protocol {
/**
* A plaintext framing that includes persistent connections.
*
* <p>This version of OkHttp implements <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC
* 2616</a>, and tracks revisions to that spec.
* <p>This version of OkHttp implements <a href="https://tools.ietf.org/html/rfc7230">RFC
* 7230</a>, and tracks revisions to that spec.
*/
HTTP_1_1("http/1.1"),

Expand Down
Expand Up @@ -212,7 +212,7 @@ private Response cacheWritingResponse(final CacheRequest cacheRequest, Response
.build();
}

/** Combines cached headers with a network headers as defined by RFC 2616, 13.5.3. */
/** Combines cached headers with a network headers as defined by RFC 7234, 4.3.4. */
private static Headers combine(Headers cachedHeaders, Headers networkHeaders) {
Headers.Builder result = new Headers.Builder();

Expand Down
Expand Up @@ -295,7 +295,7 @@ private long computeFreshnessLifetime() {

/**
* Returns the current age of the response, in milliseconds. The calculation is specified by RFC
* 2616, 13.2.3 Age Calculations.
* 7234, 4.2.3 Calculating Age.
*/
private long cacheResponseAge() {
long apparentReceivedAge = servedDate != null
Expand Down
4 changes: 2 additions & 2 deletions okhttp/src/main/java/okhttp3/internal/http/HttpDate.java
Expand Up @@ -37,7 +37,7 @@ public final class HttpDate {
private static final ThreadLocal<DateFormat> STANDARD_DATE_FORMAT =
new ThreadLocal<DateFormat>() {
@Override protected DateFormat initialValue() {
// RFC 2616 specified: RFC 822, updated by RFC 1123 format with fixed GMT.
// Date format specified by RFC 7231 section 7.1.1.1.
DateFormat rfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.US);
rfc1123.setLenient(false);
rfc1123.setTimeZone(UTC);
Expand Down Expand Up @@ -90,7 +90,7 @@ public static Date parse(String value) {
if (format == null) {
format = new SimpleDateFormat(BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS[i], Locale.US);
// Set the timezone to use when interpreting formats that don't have a timezone. GMT is
// specified by RFC 2616.
// specified by RFC 7231.
format.setTimeZone(UTC);
BROWSER_COMPATIBLE_DATE_FORMATS[i] = format;
}
Expand Down

0 comments on commit ee5cf50

Please sign in to comment.