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:
Norman Maurer 2015-11-24 05:21:28 +01:00
parent d67fea606b
commit c6d43667d4

View File

@ -63,7 +63,7 @@ public interface Http2HeadersEncoder {
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() {
@Override
@ -71,4 +71,14 @@ public interface Http2HeadersEncoder {
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;
}
};
}