-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call refreshScope() once when saving all contexts #8205
base: main
Are you sure you want to change the base?
Call refreshScope() once when saving all contexts #8205
Conversation
Be good to add tests. |
Do you have numbers? (Just curiosity.) |
|
Thank you. Agreed.
You can mock the |
It looks like the only way to verify |
Making |
recheck |
Is this old enough that it needs rebase to properly pickup CLA? |
No. |
Exposing the method would not make much difference as we can't still tell if it's called or not, we should check that through Regarding the duplication, that should not be needed as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a ZAP comment after the license header (same for Session class).
@@ -114,6 +114,7 @@ public abstract class HttpHeader implements java.io.Serializable { | |||
public static final String REFRESH = "refresh"; | |||
public static final Pattern patternCRLF = Pattern.compile("\\r\\n", Pattern.MULTILINE); | |||
public static final Pattern patternLF = Pattern.compile("\\n", Pattern.MULTILINE); | |||
private static final Pattern patternHeaderLF = Pattern.compile("(?<!\\r)\\n", Pattern.MULTILINE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PATTERN_NEWLINES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As well as or instead of multi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's for the name of the constant.
…ment Signed-off-by: Patrick Double <pat@patdouble.com>
Signed-off-by: Patrick Double <pat@patdouble.com>
5a40aa7
to
c38b3db
Compare
As far as I can tell testGui does not have visibility into test. IDEA doesn't recognize
but it doesn't help. If you know, could you post the gradle code? |
When updating context information, ZAP calls saveAllContexts(). Each context save results in a call to refreshScope(). This is unnecessary. This PR calls refreshScope() after all contexts are saved.
In addition, a performance hit compiling a regex repeatedly was found and fixed.