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

Method compareAuthority

java/org/apache/coyote/http2/Stream.java:546–566  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

544
545
546 private void compareAuthority(String value) {
547 int i;
548 try {
549 i = Host.parse(value);
550 if (i == -1 &&
551 (!value.equals(coyoteRequest.serverName().getString()) || coyoteRequest.getServerPort() != -1) ||
552 i > -1 && ((!value.substring(0, i).equals(coyoteRequest.serverName().getString()) ||
553 Integer.parseInt(value.substring(i + 1)) != coyoteRequest.getServerPort()))) {
554 // Host value inconsistent
555 headerException = new StreamException(
556 sm.getString("stream.host.inconsistent", getConnectionId(), getIdAsString(), value,
557 coyoteRequest.serverName().getString(),
558 Integer.toString(coyoteRequest.getServerPort())),
559 Http2Error.PROTOCOL_ERROR, getIdAsInt());
560 }
561 } catch (IllegalArgumentException iae) {
562 // Bad :authority / host header -> 400 response
563 coyoteRequest.setNote(Request.NOTE_BAD_REQUEST, Boolean.TRUE);
564 }
565
566 }
567
568
569 @Override

Callers 1

emitHeaderMethod · 0.95

Calls 11

parseMethod · 0.95
getConnectionIdMethod · 0.95
serverNameMethod · 0.80
getIdAsStringMethod · 0.80
getIdAsIntMethod · 0.80
equalsMethod · 0.65
getStringMethod · 0.65
getServerPortMethod · 0.65
toStringMethod · 0.65
setNoteMethod · 0.65
parseIntMethod · 0.45

Tested by

no test coverage detected