Skip to content

Commit fea8745

Browse files
saturnismsduskis
authored andcommitted
---
yaml --- r: 35063 b: refs/heads/autosynth-websecurityscanner c: 3d009ca h: refs/heads/master i: 35061: d0be9a7 35059: 24cfb14 35055: db016f2
1 parent 39e424c commit fea8745

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

  • branches/autosynth-websecurityscanner/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ refs/heads/autosynth-speech: c563dcd420cce0a37c39b1b9c24be1b9ba604dc7
142142
refs/heads/autosynth-tasks: 25d1eafe8cb66b00e3dad765dac74a5b45b83e63
143143
refs/heads/autosynth-texttospeech: 7a3ad430dddaed7a76f2026064502680c9339915
144144
refs/heads/autosynth-trace: 31564421a4b29f8257a6daea7f9a19838ac6459f
145-
refs/heads/autosynth-websecurityscanner: bf3687b1c526aeaa55d31db80f0ef9a5906b1f0f
145+
refs/heads/autosynth-websecurityscanner: 3d009ca310a49f40f0fa5d7c7861dfc97da8121a
146146
refs/heads/bigquerystorage: 06db74d123d7f8a3ef48755c2fcabed09faf8e64
147147
refs/heads/elharo-patch-1: ce159ef828d3c545991ff78e7b6e0d912a9453e9
148148
refs/heads/snyk-fix-r0punm: 1f0e6519ffd9f6cc09bcce1ccdf3fb61b6f4f9b5

branches/autosynth-websecurityscanner/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ public static String getAttribute(String attributeName) {
7373
connection.setConnectTimeout(TIMEOUT_MS);
7474
connection.setReadTimeout(TIMEOUT_MS);
7575
connection.setRequestProperty("Metadata-Flavor", "Google");
76-
InputStream input = connection.getInputStream();
77-
if (connection.getResponseCode() == 200) {
78-
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
79-
return reader.readLine();
76+
try (InputStream input = connection.getInputStream()) {
77+
if (connection.getResponseCode() == 200) {
78+
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
79+
return reader.readLine();
80+
}
8081
}
8182
}
8283
} catch (IOException ignore) {

0 commit comments

Comments
 (0)