Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nathan OBrian
Nebulo
Commits
855566ae
Commit
855566ae
authored
Aug 10, 2019
by
Daniel Wolf
Browse files
Consider an etag the same as its weak counterpart
parent
b459d997
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/service/RuleImportService.kt
View file @
855566ae
...
...
@@ -193,10 +193,10 @@ class RuleImportService : IntentService("RuleImportService") {
val
realChecksum
=
it
.
checksum
?.
replace
(
"<qt>"
,
"\""
)
if
(
realChecksum
!=
null
)
request
.
header
(
"If-None-Match"
,
realChecksum
)
response
=
httpClient
.
newCall
(
request
.
build
()).
execute
()
val
receivedChecksum
=
response
?
.
headers
.
find
{
val
receivedChecksum
=
response
.
headers
.
find
{
it
.
first
.
equals
(
"etag"
,
true
)
}
?.
second
val
localDataIsRecent
=
response
.
code
==
304
||
(
realChecksum
!=
null
&&
receivedChecksum
==
realChecksum
)
val
localDataIsRecent
=
response
.
code
==
304
||
(
realChecksum
!=
null
&&
(
receivedChecksum
==
realChecksum
||
receivedChecksum
==
"W/$realChecksum"
)
)
when
{
response
.
isSuccessful
&&
!
localDataIsRecent
->
{
response
.
headers
.
find
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment