Skip to content

Commit d5aa10f

Browse files
committed
Remove most debug logging from AzureHttpHandler
1 parent c566966 commit d5aa10f

File tree

1 file changed

+16
-31
lines changed

1 file changed

+16
-31
lines changed

test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ public void handle(final HttpExchange exchange) throws IOException {
283283
String batchBoundary = requestReader.readLine();
284284
String responseBoundary = "batch_" + UUID.randomUUID();
285285

286-
logger.debug("Batch boundary: " + batchBoundary);
287286
String line;
288287
String contentId = null, requestId = null, toDelete = null;
289288
while ((line = requestReader.readLine()) != null) {
@@ -341,37 +340,23 @@ public void handle(final HttpExchange exchange) throws IOException {
341340
toDelete = null;
342341
contentId = null;
343342
requestId = null;
344-
345-
logger.debug("--> Starting a new batch");
346-
} else if (line.startsWith("Content-Type")
347-
|| line.startsWith("Content-Transfer-Encoding")
348-
|| line.startsWith("Accept")
349-
|| line.startsWith("Content-Length")
350-
|| line.startsWith("User-Agent")
351-
|| line.startsWith("Date")
352-
|| line.isBlank()) {
353-
// Ignore
354-
} else if (Regex.simpleMatch("x-ms-client-request-id: *", line)) {
355-
if (requestId != null) {
356-
throw new IllegalStateException("Got multiple request IDs in a single request?");
357-
}
358-
requestId = line.split("\\s")[1];
359-
} else if (Regex.simpleMatch("Content-ID: *", line)) {
360-
if (contentId != null) {
361-
throw new IllegalStateException("Got multiple content IDs in a single request?");
362-
}
363-
contentId = line.split("\\s")[1];
364-
} else if (Regex.simpleMatch("DELETE /" + container + "/*", line)) {
365-
logger.debug("--> Got delete line: " + line);
366-
String blobName = RestUtils.decodeComponent(line.split("(\\s|\\?)")[1]);
367-
logger.debug("--> Deleting blob: " + blobName);
368-
if (toDelete != null) {
369-
throw new IllegalStateException("Got multiple deletes in a single request?");
370-
}
371-
toDelete = blobName;
372-
} else {
373-
logger.debug("--> Ignoring line: " + line);
343+
} else if (Regex.simpleMatch("x-ms-client-request-id: *", line)) {
344+
if (requestId != null) {
345+
throw new IllegalStateException("Got multiple request IDs in a single request?");
346+
}
347+
requestId = line.split("\\s")[1];
348+
} else if (Regex.simpleMatch("Content-ID: *", line)) {
349+
if (contentId != null) {
350+
throw new IllegalStateException("Got multiple content IDs in a single request?");
374351
}
352+
contentId = line.split("\\s")[1];
353+
} else if (Regex.simpleMatch("DELETE /" + container + "/*", line)) {
354+
String blobName = RestUtils.decodeComponent(line.split("(\\s|\\?)")[1]);
355+
if (toDelete != null) {
356+
throw new IllegalStateException("Got multiple deletes in a single request?");
357+
}
358+
toDelete = blobName;
359+
}
375360
}
376361
response.append("--").append(responseBoundary).append("--\r\n0\r\n");
377362
// Send the response

0 commit comments

Comments
 (0)