use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpResponseEncoder method encodeHeaders.
@Override
protected void encodeHeaders(HttpHeaders headers, ByteBuf buf) {
if (headers instanceof HeadersMultiMap) {
HeadersMultiMap vertxHeaders = (HeadersMultiMap) headers;
vertxHeaders.encode(buf);
} else {
super.encodeHeaders(headers, buf);
}
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class Http1xServerResponse method trailers.
@Override
public MultiMap trailers() {
if (trailers == null) {
HeadersMultiMap v = HeadersMultiMap.httpHeaders();
trailers = v;
trailingHeaders = v;
}
return trailers;
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpHeadersTest method testNonCharSequenceValue.
@Test
public void testNonCharSequenceValue() {
HeadersMultiMap mmap = newMultiMap();
mmap.set("key1", 0);
assertEquals("0", mmap.get("key1"));
mmap.set((CharSequence) "key2", 1);
assertEquals("1", mmap.get("key2"));
mmap.set("key3", Arrays.asList(2, 3));
assertEquals("2", mmap.get("key3"));
mmap.set((CharSequence) "key4", Arrays.asList(4, 5));
assertEquals("4", mmap.get("key4"));
mmap.add("key5", 6);
assertEquals("6", mmap.get("key5"));
mmap.add((CharSequence) "key6", 7);
assertEquals("7", mmap.get("key6"));
mmap.add("key8", Arrays.asList(2, 3));
assertEquals("2", mmap.get("key8"));
mmap.add((CharSequence) "key9", Arrays.asList(4, 5));
assertEquals("4", mmap.get("key9"));
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpHeadersTest method testContainsValue1.
@Test
public void testContainsValue1() {
HeadersMultiMap mmap = newMultiMap();
mmap.add("foo", "val1,val2,val3");
assertTrue(mmap.containsValue("foo", "val1", true));
assertTrue(mmap.containsValue("foo", "val2", true));
assertTrue(mmap.containsValue("foo", "val3", true));
assertTrue(mmap.containsValue("foo", "VAL1", true));
assertTrue(mmap.containsValue("foo", "VAL2", true));
assertTrue(mmap.containsValue("foo", "VAL3", true));
assertFalse(mmap.containsValue("foo", "val4", true));
assertFalse(mmap.containsValue("foo", "helloworld", true));
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpHeadersTest method testContainsValue2.
@Test
public void testContainsValue2() {
HeadersMultiMap mmap = newMultiMap();
mmap.add("foo", "val1 , val2 , val3");
assertTrue(mmap.containsValue("foo", "val1", true));
assertTrue(mmap.containsValue("foo", "val2", true));
assertTrue(mmap.containsValue("foo", "val3", true));
assertFalse(mmap.containsValue("foo", "val4", true));
assertFalse(mmap.containsValue("foo", "helloworld", true));
}
Aggregations