Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
usfalami committed Jul 3, 2023
1 parent 0b83af2 commit b2be6e9
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static java.lang.System.currentTimeMillis;
import static java.time.Instant.ofEpochMilli;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static java.util.Optional.ofNullable;
import static org.springframework.http.HttpHeaders.AUTHORIZATION;
Expand Down Expand Up @@ -54,19 +53,17 @@ public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttp
out.setStart(ofEpochMilli(beg));
out.setEnd(ofEpochMilli(fin));
out.setOutDataSize(nonNull(body) ? body.length : 0);
out.setThreadName(threadName());
if(nonNull(res)) {
out.setStatus(res.getStatusCode().value());
out.setInDataSize(res.getBody().available()); //not exact !?
out.setContentType(ofNullable(res.getHeaders().getContentType()).map(MediaType::getType).orElse(null));
}
out.setThreadName(threadName());
var trc = localTrace.get();
if(isNull(trc)) { //no session
//orphan
}
else {
if(nonNull(trc)) { //no session
trc.append(out);
}
//else orphan
}
catch(Exception e) {
//do not catch exception
Expand Down

0 comments on commit b2be6e9

Please sign in to comment.