Skip to content

Commit 22bab53

Browse files
committed
test 3
1 parent 2f60db3 commit 22bab53

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

frontend/server/src/main/java/org/pytorch/serve/http/TokenAuthorizationHandler.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ private void checkTokenAuthorization(FullHttpRequest req, String type) throws Mo
107107
// String token = arrOfStr[1];
108108
// System.out.println("TEST -----" + token + "-----");
109109

110-
if (result == "false") {// if (!result) {
111-
throw new InvalidKeyException(
112-
"Token Authentication failed. Token either incorrect, expired, or not provided correctly");
113-
}
110+
// if (!result) {
111+
throw new InvalidKeyException(
112+
"Token Authentication failed. Token either incorrect, expired, or not provided correctly");
113+
//}
114114
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
115115
e.printStackTrace();
116116
throw new InvalidKeyException(

plugins/endpoints/src/main/java/org/pytorch/serve/plugins/endpoint/Token.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ public String checkTokenAuthorization(FullHttpRequest req, String type) {
181181

182182
if (token.equals(key)) {
183183
if (expiration != null && isTokenExpired(expiration)) {
184-
return "false"; //token + "-" + key; // false;
184+
return token + "-2-" + key; // false;
185185
}
186186
} else {
187-
return "false"; //token + "-" + key; // false;
187+
return token + "-1-" + key; // false;
188188
}
189-
return token + "-" + key; // true;
189+
return token + "-3-" + key; // true;
190190
}
191191

192192
public boolean isTokenExpired(Instant expirationTime) {

0 commit comments

Comments
 (0)