MCPcopy Index your code
hub / github.com/apache/tomcat / receivedEndOfHeaders

Method receivedEndOfHeaders

java/org/apache/coyote/http2/Stream.java:587–621  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

585
586
587 final boolean receivedEndOfHeaders() throws StreamException {
588 boolean missingHeader = false;
589
590 if (coyoteRequest.getMethod() == null) {
591 missingHeader = true;
592 } else if (Method.CONNECT.equals(coyoteRequest.getMethod())) {
593 // CONNECT only
594 if (!coyoteRequest.scheme().isNull() || !coyoteRequest.requestURI().isNull()) {
595 throw new StreamException(
596 sm.getString("stream.header.invalidConnect", getConnectionId(), getIdAsString()),
597 Http2Error.PROTOCOL_ERROR, getIdAsInt());
598 }
599 if (coyoteRequest.serverName().isNull()) {
600 missingHeader = true;
601 }
602 } else {
603 // All other methods
604 if (coyoteRequest.scheme().isNull() || coyoteRequest.requestURI().isNull()) {
605 missingHeader = true;
606 }
607 }
608
609 if (missingHeader) {
610 throw new StreamException(sm.getString("stream.header.required", getConnectionId(), getIdAsString()),
611 Http2Error.PROTOCOL_ERROR, getIdAsInt());
612 }
613
614 // Cookie headers need to be concatenated into a single header
615 // See RFC 7540 8.1.2.5
616 // Can only do this once the headers are fully received
617 if (cookieHeader != null) {
618 coyoteRequest.getMimeHeaders().addValue("cookie").setString(cookieHeader.toString());
619 }
620 return headerState == HEADER_STATE_REGULAR || headerState == HEADER_STATE_PSEUDO;
621 }
622
623
624 final void writeHeaders() throws IOException {

Callers 1

headersEndMethod · 0.80

Calls 14

getConnectionIdMethod · 0.95
schemeMethod · 0.80
requestURIMethod · 0.80
getIdAsStringMethod · 0.80
getIdAsIntMethod · 0.80
serverNameMethod · 0.80
addValueMethod · 0.80
getMethodMethod · 0.65
equalsMethod · 0.65
isNullMethod · 0.65
getStringMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected