Skip to content

Commit ee6c9d7

Browse files
committed
Add scary JavaDoc to Metadata.setAuthority()
1 parent dbf7d52 commit ee6c9d7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

core/src/main/java/io/grpc/Metadata.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,15 @@ public String getAuthority() {
287287
return authority;
288288
}
289289

290+
/**
291+
* Override the HTTP/2 authority the channel claims to be connecting to. <em>This is not
292+
* generally safe.</em> Overriding allows advanced users to re-use a single Channel for multiple
293+
* services, even if those services are hosted on different domain names. That assumes the
294+
* server is virtually hosting multiple domains and is guaranteed to continue doing so. It is
295+
* rare for a service provider to make such a guarantee. <em>At this time, there is no security
296+
* verification of the overridden value, such as making sure the authority matches the server's
297+
* TLS certificate.</em>
298+
*/
290299
public void setAuthority(String authority) {
291300
this.authority = authority;
292301
}

0 commit comments

Comments
 (0)