MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / redirect

Method redirect

src/tsd/HttpQuery.java:461–470  ·  view source on GitHub ↗

Redirects the client's browser to the given location.

(final String location)

Source from the content-addressed store, hash-verified

459
460 /** Redirects the client's browser to the given location. */
461 public void redirect(final String location) {
462 // set the header AND a meta refresh just in case
463 response().headers().set("Location", location);
464 sendReply(HttpResponseStatus.OK,
465 new StringBuilder(
466 "<html></head><meta http-equiv=\"refresh\" content=\"0; url="
467 + location + "\"></head></html>")
468 .toString().getBytes(this.getCharset())
469 );
470 }
471
472 /**
473 * Escapes a string appropriately to be a valid in JSON.

Callers 3

redirectMethod · 0.95
redirectNullMethod · 0.95
executeMethod · 0.45

Calls 6

sendReplyMethod · 0.95
setMethod · 0.80
responseMethod · 0.80
getCharsetMethod · 0.80
getBytesMethod · 0.45
toStringMethod · 0.45

Tested by 2

redirectMethod · 0.76
redirectNullMethod · 0.76