mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Convert request factory components into a module
Move all of the code to create the request factories into RequestFactoryModule. Also add the --force_http_connection flag to allow us to force the use of HTTP connections instead of HTTPOverRPC for our internal connections. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146116640
This commit is contained in:
parent
b70f57b7c7
commit
ecbe2662ac
9 changed files with 99 additions and 157 deletions
|
@ -51,7 +51,7 @@ class AppEngineConnection implements Connection {
|
|||
private static final Pattern HTML_TITLE_TAG_PATTERN = Pattern.compile("<title>(.*?)</title>");
|
||||
|
||||
@Inject HttpRequestFactory requestFactory;
|
||||
@Inject HostAndPort server;
|
||||
@Inject AppEngineConnectionFlags flags;
|
||||
|
||||
@Inject
|
||||
AppEngineConnection() {}
|
||||
|
@ -144,11 +144,11 @@ class AppEngineConnection implements Connection {
|
|||
}
|
||||
|
||||
HostAndPort getServer() {
|
||||
return server.withDefaultPort(443); // Default to HTTPS port if unspecified.
|
||||
return flags.getServer().withDefaultPort(443); // Default to HTTPS port if unspecified.
|
||||
}
|
||||
|
||||
boolean isLocalhost() {
|
||||
return server.getHostText().equals("localhost");
|
||||
return flags.getServer().getHostText().equals("localhost");
|
||||
}
|
||||
|
||||
private String getUserId() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue