Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
smthing committed Nov 4, 2024
1 parent 70a2ebc commit 191a678
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,19 @@ public CompletableFuture<Object> getCompletableFuture() {
@Override
public PushBuilder newPushBuilder() {
org.smartboot.http.server.PushBuilder pushBuilder = request.newPushBuilder();
if (pushBuilder == null) {
return null;
}
String sessionId;
HttpSession session = getSession(false);
if (session != null) {
sessionId = session.getId();
} else {
sessionId = getRequestedSessionId();
}
if (sessionId != null) {
pushBuilder.setHeader(HeaderNameEnum.COOKIE.getName(), "JSESSIONID=" + sessionId);
}
return new PushBuilder() {
@Override
public PushBuilder method(String method) {
Expand Down Expand Up @@ -955,7 +968,7 @@ public String getQueryString() {

@Override
public String getSessionId() {
return pushBuilder.getSessionId();
return sessionId;
}

@Override
Expand Down

0 comments on commit 191a678

Please sign in to comment.