Skip to content

Commit

Permalink
add ETag if not null. (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robothy authored Sep 22, 2023
1 parent 5abe864 commit 53e1451
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;

/**
* LocalS3 response utils.
Expand Down Expand Up @@ -42,14 +43,16 @@ public static void addServerHeader(HttpResponse response) {
response.putHeader(HttpHeaderNames.SERVER.toString(), LocalS3Constants.SERVER_NAME);
}

/**
/**
* Add 'ETag' header.
*
* @param response the response to add 'ETag' header.
* @param etag the etag to add
*/
public static void addETag(HttpResponse response, String etag) {
response.putHeader(HttpHeaderNames.ETAG.toString(), etag);
if (Objects.nonNull(etag)) {
response.putHeader(HttpHeaderNames.ETAG.toString(), etag);
}
}

/**
Expand Down

0 comments on commit 53e1451

Please sign in to comment.