Skip to content

#1002 fix eagerly cacheable function to support query field from v5 s…#1006

Merged
tommysitu merged 1 commit into
masterfrom
fix-eagerly-cacheable-check
Feb 8, 2022
Merged

#1002 fix eagerly cacheable function to support query field from v5 s…#1006
tommysitu merged 1 commit into
masterfrom
fix-eagerly-cacheable-check

Conversation

@tommysitu

Copy link
Copy Markdown
Member

…imulation

this.Method == nil || len(this.Method) != 1 || this.Method[0].Matcher != matchers.Exact ||
this.Path == nil || len(this.Path) != 1 || this.Path[0].Matcher != matchers.Exact ||
this.DeprecatedQuery == nil || len(this.DeprecatedQuery) != 1 || this.DeprecatedQuery[0].Matcher != matchers.Exact ||
this.DeprecatedQuery != nil && len(this.DeprecatedQuery) == 1 && this.DeprecatedQuery[0].Matcher != matchers.Exact ||

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only check this deprecated field when it's present

Comment on lines +225 to +234
if this.Query != nil && len(*this.Query) > 0 {
for key, valueMatchers := range *this.Query {
for _, valueMatcher := range valueMatchers {
if valueMatcher.Matcher != matchers.Exact {
return nil
}
query[key] = []string{valueMatcher.Value.(string)}
}
}
} else if this.DeprecatedQuery != nil && len(this.DeprecatedQuery) == 1 {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should check the new query matchers first

@tommysitu
tommysitu force-pushed the fix-eagerly-cacheable-check branch from 82d76f6 to 8a96e4c Compare February 8, 2022 23:43
@tommysitu
tommysitu force-pushed the fix-eagerly-cacheable-check branch from 8a96e4c to 9da2953 Compare February 8, 2022 23:45
@tommysitu
tommysitu merged commit 074e419 into master Feb 8, 2022
@tommysitu
tommysitu deleted the fix-eagerly-cacheable-check branch August 7, 2022 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant