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

Commit a623475

Browse files
committed
clean up
1 parent d629ac3 commit a623475

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public synchronized String assignSessionID(final HttpExchange exchange){
5959
* Returns the session of the client or assigns one if it does not yet have one Session will only be saved client side if the exchange headers are sent using {@link HttpExchange#sendResponseHeaders(int, long)}.
6060
*
6161
* @param exchange http exchange
62+
* @return session associated with the exchange
6263
*
6364
* @since 03.03.00
6465
* @author Ktt Development
@@ -136,6 +137,7 @@ public final String toString(){
136137
.setHttpOnly(true)
137138
.build();
138139
exchange.getResponseHeaders().add("Set-Cookie",out.toCookieHeaderString());
140+
sessions.put(sessionId,session);
139141
}else{
140142
session = sessions.get(sessionId);
141143
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ public final String toCookieHeaderString(){
113113
final StringBuilder OUT = new StringBuilder();
114114
OUT.append(name).append("=").append(value);
115115
if(expires != null)
116-
OUT.append("; Expires=").append(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(expires)).append(" GMT");
116+
OUT.append("; Expires=").append(sdf.format(expires)).append(" GMT");
117117
if(maxAge != null)
118118
OUT.append("; Max-Age=").append(maxAge);
119119
if(domain != null)
120120
OUT.append("; Domain=").append(domain);
121121
if(path != null)
122122
OUT.append("; Path=").append(path);
123123
if(secure != null && secure)
124-
OUT.append("; Secure=").append(secure);
124+
OUT.append("; Secure=").append(true);
125125
if(httpOnly != null && httpOnly)
126-
OUT.append("; HttpOnly=").append(httpOnly);
126+
OUT.append("; HttpOnly=").append(true);
127127
if(sameSite != null)
128128
OUT.append("; SameSite=").append(sameSite);
129129

src/main/java/com/kttdevelopment/simplehttpserver/handler/DirectoryEntry.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* @version 02.00.00
1616
* @author Ktt Development
1717
*/
18-
@SuppressWarnings("SpellCheckingInspection")
1918
class DirectoryEntry {
2019

2120
private final boolean isWalkthrough;

0 commit comments

Comments
 (0)