org.zodiac.netty.http.headers.PragmaHeader Maven / Gradle / Ivy
package org.zodiac.netty.http.headers;
import org.zodiac.commons.http.entities.CacheControl;
import org.zodiac.commons.http.entities.CacheControlTypes;
import io.netty.util.AsciiString;
/**
* Handles the HTTP 1.0 Pragma: no-cache
header style.
*
*/
final class PragmaHeader extends AbstractHeader {
static final AsciiString PRAGMA = AsciiString.cached("pragma");
private static final AsciiString NO_CACHE = AsciiString.cached("no-cache");
private static final CacheControl RESP = CacheControl.$(CacheControlTypes.no_cache);
PragmaHeader() {
super(CacheControl.class, PRAGMA);
}
@Override
public CacheControl toValue(CharSequence value) {
if (NO_CACHE.contentEqualsIgnoreCase(value)) {
return RESP;
}
return null;
}
}