mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add framework for customizable WHOIS commands
With some additional changes by Ben McIlwain. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=145447136
This commit is contained in:
parent
d3fe6be385
commit
bb3a0c78c5
15 changed files with 155 additions and 47 deletions
|
@ -132,6 +132,7 @@ public final class WhoisHttpServer implements Runnable {
|
|||
@Inject Response response;
|
||||
@Inject @Config("whoisDisclaimer") String disclaimer;
|
||||
@Inject @Config("whoisHttpExpires") Duration expires;
|
||||
@Inject @Config("whoisCommandFactory") WhoisCommandFactory commandFactory;
|
||||
@Inject @RequestPath String requestPath;
|
||||
@Inject WhoisHttpServer() {}
|
||||
|
||||
|
@ -144,7 +145,8 @@ public final class WhoisHttpServer implements Runnable {
|
|||
String command = decode(JOINER.join(SLASHER.split(path.substring(PATH.length())))) + "\r\n";
|
||||
Reader reader = new StringReader(command);
|
||||
DateTime now = clock.nowUtc();
|
||||
sendResponse(SC_OK, new WhoisReader(reader, now).readCommand().executeQuery(now));
|
||||
sendResponse(
|
||||
SC_OK, new WhoisReader(reader, commandFactory, now).readCommand().executeQuery(now));
|
||||
} catch (WhoisException e) {
|
||||
sendResponse(e.getStatus(), e);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue