Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit e2dfc9b

Browse files
committed
fix hostname generation in get-client-lib
* get-client-lib reversed the hostname and base path parameters sent to GetDiscoveryDocAction. * get-client-lib gave a null hostname rather than myapp.appspot.com if -h and appengine-web.xml didn't have an app id.
1 parent c40af2f commit e2dfc9b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

endpoints-framework-tools/src/main/java/com/google/api/server/spi/tools/EndpointsToolAction.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ protected String getHostname(Option hostnameOption, String warPath) {
230230
if (hostnameOption.getValue() != null) {
231231
return hostnameOption.getValue();
232232
}
233-
return AppEngineUtil.getApplicationDefaultHostname(warPath);
233+
String defaultHostname = AppEngineUtil.getApplicationDefaultHostname(warPath);
234+
if (defaultHostname != null) {
235+
return defaultHostname;
236+
}
237+
return DEFAULT_HOSTNAME;
234238
}
235239

236240
protected String getBasePath(Option basePathOption) {

endpoints-framework-tools/src/main/java/com/google/api/server/spi/tools/GetClientLibAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Object getClientLib(URL[] classPath, String language, String outputDirPat
8282
List<String> serviceClassNames, String buildSystem, String hostname, String basePath,
8383
boolean debug) throws ClassNotFoundException, IOException, ApiConfigException {
8484
Map<String, String> discoveryDocs = new GetDiscoveryDocAction().getDiscoveryDoc(
85-
classPath, outputDirPath, serviceClassNames, basePath, hostname, debug /* outputToDisk */);
85+
classPath, outputDirPath, serviceClassNames, hostname, basePath, debug /* outputToDisk */);
8686
for (Map.Entry<String, String> entry : discoveryDocs.entrySet()) {
8787
new GenClientLibAction().genClientLib(language, outputDirPath, entry.getValue(), buildSystem);
8888
}

0 commit comments

Comments
 (0)