Skip to content

Commit ee5cf50

Browse files
authored
Update some comments to point at current RFCs (square#3561)
square#930
1 parent 57891fe commit ee5cf50

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

okhttp/src/main/java/okhttp3/CacheControl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
* A Cache-Control header with cache directives from a server or client. These directives set policy
99
* on what responses can be stored, and which requests can be satisfied by those stored responses.
1010
*
11-
* <p>See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">RFC 2616,
12-
* 14.9</a>.
11+
* <p>See <a href="https://tools.ietf.org/html/rfc7234#section-5.2">RFC 7234, 5.2</a>.
1312
*/
1413
public final class CacheControl {
1514
/**

okhttp/src/main/java/okhttp3/Protocol.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public enum Protocol {
3535
/**
3636
* A plaintext framing that includes persistent connections.
3737
*
38-
* <p>This version of OkHttp implements <a href="http://github.com/%3Cspan%20class="x x-first x-last">http://www.ietf.org/rfc/rfc2616.txt">RFC
39-
* 2616</a>, and tracks revisions to that spec.
38+
* <p>This version of OkHttp implements <a href="http://github.com/%3Cspan%20class="x x-first x-last">https://tools.ietf.org/html/rfc7230">RFC
39+
* 7230</a>, and tracks revisions to that spec.
4040
*/
4141
HTTP_1_1("http/1.1"),
4242

okhttp/src/main/java/okhttp3/internal/cache/CacheInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private Response cacheWritingResponse(final CacheRequest cacheRequest, Response
212212
.build();
213213
}
214214

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

okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ private long computeFreshnessLifetime() {
295295

296296
/**
297297
* Returns the current age of the response, in milliseconds. The calculation is specified by RFC
298-
* 2616, 13.2.3 Age Calculations.
298+
* 7234, 4.2.3 Calculating Age.
299299
*/
300300
private long cacheResponseAge() {
301301
long apparentReceivedAge = servedDate != null

okhttp/src/main/java/okhttp3/internal/http/HttpDate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public final class HttpDate {
3737
private static final ThreadLocal<DateFormat> STANDARD_DATE_FORMAT =
3838
new ThreadLocal<DateFormat>() {
3939
@Override protected DateFormat initialValue() {
40-
// RFC 2616 specified: RFC 822, updated by RFC 1123 format with fixed GMT.
40+
// Date format specified by RFC 7231 section 7.1.1.1.
4141
DateFormat rfc1123 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.US);
4242
rfc1123.setLenient(false);
4343
rfc1123.setTimeZone(UTC);
@@ -90,7 +90,7 @@ public static Date parse(String value) {
9090
if (format == null) {
9191
format = new SimpleDateFormat(BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS[i], Locale.US);
9292
// Set the timezone to use when interpreting formats that don't have a timezone. GMT is
93-
// specified by RFC 2616.
93+
// specified by RFC 7231.
9494
format.setTimeZone(UTC);
9595
BROWSER_COMPATIBLE_DATE_FORMATS[i] = format;
9696
}

0 commit comments

Comments
 (0)