Skip to content

Commit 83d059a

Browse files
committed
fix:修改缓存时间小于0时,设置为no_cache
1 parent e1fe366 commit 83d059a

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

FlowHttp/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
//ext.GROUP = "com.lute.network"
88
//ext.POM_ARTIFACT_ID = "NetCore-Flow"
9-
//ext.VERSION_NAME = "1.6.6"
9+
//ext.VERSION_NAME = "1.6.7"
1010
////引用gradle_upload.gradle
1111
//apply from: "${project.rootDir}/maven_upload.gradle"
1212

@@ -19,7 +19,7 @@ afterEvaluate {
1919
// 这里头是artifacts的配置信息,不填会采用默认的
2020
groupId = 'com.github.buhuiming'
2121
artifactId = 'NetCore-Flow'
22-
version = '1.6.6'
22+
version = '1.6.7'
2323

2424
from components.release
2525
artifact androidSourcesJar //打包源码,去除这行打的包将看不到源码

FlowHttp/src/main/java/com/bhm/network/core/interceptor/CacheInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CacheInterceptor {
3636
response.newBuilder()
3737
.removeHeader("Pragma")
3838
.removeHeader(CACHE_CONTROL)
39-
.header(CACHE_CONTROL, "public, max-age=$maxAge")
39+
.header(CACHE_CONTROL, if (maxAge < 0) "no-cache" else "public, max-age=$maxAge")
4040
.build()
4141
} else {
4242
// 无网络时,缓存为3天

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111

1212
dependencies {
13-
implementation 'com.github.buhuiming:NetCore-Flow:1.6.6'
13+
implementation 'com.github.buhuiming:NetCore-Flow:1.6.7'
1414
}
1515

1616
#### 1、Application配置默认的全局配置项(可选)

0 commit comments

Comments
 (0)