Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 31a3e24

Browse files
committed
Forward exchange support
1 parent a2176a1 commit 31a3e24

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,18 @@ public static SimpleHttpServer create(final int port, final int backlog) throws
247247
*/
248248
public abstract HttpSession getHttpSession(final HttpExchange exchange);
249249

250+
/**
251+
* Returns the session associated with an exchange or null it no session handler exists.
252+
*
253+
* @param exchange http exchange
254+
* @return http session
255+
*
256+
* @see HttpSession
257+
* @since 03.03.00
258+
* @author Ktt Development
259+
*/
260+
public abstract HttpSession getHttpSession(final SimpleHttpExchange exchange);
261+
250262
//
251263

252264
/**

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServerImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public final HttpSession getHttpSession(final HttpExchange exchange){
120120
return sessionHandler != null ? sessionHandler.getSession(exchange) : null;
121121
}
122122

123+
@Override
124+
public final HttpSession getHttpSession(final SimpleHttpExchange exchange){
125+
return getHttpSession(exchange.getHttpExchange());
126+
}
127+
123128
//
124129

125130
@Override

0 commit comments

Comments
 (0)