zeroflag opened a new pull request, #841:
URL: https://github.com/apache/knox/pull/841

   ## What changes were proposed in this pull request?
   
   
   ## How was this patch tested?
   
   ```smalltalk
   Teapot on
       GET: '/' -> [:req |  ZnResponse noContent
        addCookie: ((ZnCookie name: 'test' value:'val') expires: 'Sun, 06 Nov 
1994 08:49:37 GMT'; yourself); 
        addCookie: ((ZnCookie name: 'test2' value:'val') expiresTimeStamp: 
DateAndTime now; yourself);          
        addCookie: ((ZnCookie name: 'test3' value:'val') expires: 'Wed, 
14-Feb-2024 09:23:27 GMT'; yourself);                   
        yourself ];
        start. 
   ```
   
   1.
   
   ```xml
       <property>
           <name>gateway.httpclient.cookieSpec</name>
           <value>default</value>
       </property>
   ```
   
   ```bash
   $ curl -vk -u admin:admin-password 
https://localhost:8443/gateway/sandbox/hive
   ```
   
   ```
   2024-02-19 10:39:43,751 bf18473d-4b63-4551-9e6a-b7ba49a531ab INFO  
knox.gateway (DefaultHttpClientFactory.java:getRequestConfig(243)) - HTTP 
client cookie spec is set to default
   2024-02-19 10:39:47,167 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Date: Mon, 19 Feb 2024 09:39:47 
GMT[\r][\n]"
   2024-02-19 10:39:47,167 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test=val; expires=Sun, 
06 Nov 1994 08:49:37 GMT[\r][\n]"
   2024-02-19 10:39:47,168 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test2=val; expires=Mon, 
19 Feb 2024 09:39:47 GMT[\r][\n]"
   2024-02-19 10:39:47,168 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test3=val; expires=Wed, 
14-Feb-2024 09:23:27 GMT[\r][\n]"
   2024-02-19 10:39:47,168 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "[\r][\n]"
   2024-02-19 10:39:47,170 85a5f49f-fb33-4dc0-8856-873d34efd366 WARN  
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(130)) - Invalid cookie header: 
"Set-Cookie: test=val; expires=Sun, 06 Nov 1994 08:49:37 GMT". Invalid 
'expires' attribute: Sun, 06 Nov 1994 08:49:37 GMT
   2024-02-19 10:39:47,171 85a5f49f-fb33-4dc0-8856-873d34efd366 WARN  
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(130)) - Invalid cookie header: 
"Set-Cookie: test2=val; expires=Mon, 19 Feb 2024 09:39:47 GMT". Invalid 
'expires' attribute: Mon, 19 Feb 2024 09:39:47 GMT
   2024-02-19 10:39:47,172 85a5f49f-fb33-4dc0-8856-873d34efd366 DEBUG 
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(119)) - Cookie accepted 
[test3="val", version:0, domain:localhost, path:/, expiry:Wed Feb 14 10:23:27 
CET 2024]
   ```
   
   2.
   
   ```xml
       <property>
           <name>gateway.httpclient.cookieSpec</name>
           <value>standard</value>
       </property>
   ```
   
   
   ```bash
   $ curl -vk -u admin:admin-password 
https://localhost:8443/gateway/sandbox/hive
   ```
   
   ```
   2024-02-19 10:38:34,374 1f05a150-b703-441c-a2f2-d1f34b3ffd3d INFO  
knox.gateway (DefaultHttpClientFactory.java:getRequestConfig(243)) - HTTP 
client cookie spec is set to standard
   2024-02-19 10:38:34,515 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test=val; 
   expires=Sun, 06 Nov 1994 08:49:37 GMT[\r][\n]"
   2024-02-19 10:38:34,516 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test2=val; expires=Mon, 
19 Feb 2024 09:38:34 GMT[\r][\n]"
   2024-02-19 10:38:34,516 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "Set-Cookie: test3=val; expires=Wed, 
14-Feb-2024 09:23:27 GMT[\r][\n]"
   2024-02-19 10:38:34,517 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG http.wire 
(Wire.java:wire(73)) - http-outgoing-0 << "[\r][\n]"
   2024-02-19 10:38:34,524 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG 
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(119)) - Cookie accepted 
[test="val", version:0, domain:localhost, path:/, expiry:Sun Nov 06 09:49:37 
CET 1994]
   2024-02-19 10:38:34,524 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG 
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(119)) - Cookie accepted 
[test2="val", version:0, domain:localhost, path:/, expiry:Mon Feb 19 10:38:34 
CET 2024]
   2024-02-19 10:38:34,524 1f05a150-b703-441c-a2f2-d1f34b3ffd3d DEBUG 
protocol.ResponseProcessCookies 
(ResponseProcessCookies.java:processCookies(119)) - Cookie accepted 
[test3="val", version:0, domain:localhost, path:/, expiry:Wed Feb 14 10:23:27 
CET 2024]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to