Add Http2HeadersEncoder.ALWAYS_SENSITIVE instance
Motivation: We already provide a NEVER_SENSITIVE instance,we should add ALWAYS_SENSITIVE as well. Modifications: Add ALWAYS_SENSITIVE instance which will always return true when check for sesitive. Result: User can reuse code.
This commit is contained in:
parent
d67fea606b
commit
c6d43667d4
@ -63,7 +63,7 @@ public interface Http2HeadersEncoder {
|
|||||||
Configuration configuration();
|
Configuration configuration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Always return {@code false} for {@link SensitivityDetector#isSensitive(ByteString, ByteString)}.
|
* Always return {@code false} for {@link SensitivityDetector#isSensitive(CharSequence, CharSequence)}.
|
||||||
*/
|
*/
|
||||||
SensitivityDetector NEVER_SENSITIVE = new SensitivityDetector() {
|
SensitivityDetector NEVER_SENSITIVE = new SensitivityDetector() {
|
||||||
@Override
|
@Override
|
||||||
@ -71,4 +71,14 @@ public interface Http2HeadersEncoder {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Always return {@code true} for {@link SensitivityDetector#isSensitive(CharSequence, CharSequence)}.
|
||||||
|
*/
|
||||||
|
SensitivityDetector ALWAYS_SENSITIVE = new SensitivityDetector() {
|
||||||
|
@Override
|
||||||
|
public boolean isSensitive(CharSequence name, CharSequence value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user