[email protected]

________________________________
De: Michael Osipov (Jira) <[email protected]>
Enviado: quinta-feira, 16 de abril de 2020 13:14
Para: [email protected] <[email protected]>
Assunto: [jira] [Commented] (HTTPCLIENT-2076) LaxExpiresHandler throws 
NullPointerException when a value is null.


    [ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085053#comment-17085053
 ]

Michael Osipov commented on HTTPCLIENT-2076:
--------------------------------------------

Maybe this should be split in two issues?

> LaxExpiresHandler throws NullPointerException when a value is null.
> -------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2076
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2076
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.5.12, 5.0
>            Reporter: Hee Jeong Kim
>            Priority: Minor
>         Attachments: fix_NPE_in_LaxExpiresHandler.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi. I'm using RFC6265LaxSpec and would like to report two issues.
> *1. LaxExpiresHandler throws NullPointerException when a value is null.*
> [This 
> line|https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/LaxExpiresHandler.java#L110]
>  line is causing NPE.
> You can easily reproduce this, with the following Set-Cookie string.
> Set-Cookie: gtinfo=info; Expires; domain=.webmd.com; path=/
> I think We need to check whether value is blank just like how 
> LaxMaxAgeHandler is doing.
> https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/LaxMaxAgeHandler.java#L60
> *2. We need to 'ignore' invalid attributes only.*
> LaxExpiresHandler throws MalformedCookieException when attribute is not 
> valid, so the cookie with invalid Expires attributes is ignored entirely. But 
> [RFC 6265|https://tools.ietf.org/html/rfc6265#section-5.2.1] says, '_If the 
> attribute-value failed to parse as a cookie date, ignore the cookie-av._'
> I think we should not throw MalformedCookieException but just ignore invalid 
> attributes only. LaxMaxAgeHandler is also already doing this.
> https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/LaxMaxAgeHandler.java#L69
> https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/LaxMaxAgeHandler.java#L61
> Followings are the classes needs to be considered.
> - BasicExpiresHandler
> - BasicMaxAgeHandler
> - LaxExpiresHandler
> Thanks.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




"Esta mensagem e reservada e sua divulgacao, distribuicao, reproducao ou 
qualquer forma de uso e proibida e depende de previa autorizacao desta 
instituicao. O remetente utiliza o correio eletronico no exercicio do seu 
trabalho ou em razao dele, eximindo esta instituicao de qualquer 
responsabilidade por utilizacao indevida. Se voce recebeu esta mensagem por 
engano, favor elimina-la imediatamente."

"This message is reserved and its disclosure, distribution, reproduction or any 
other form of use is prohibited and shall depend upon previous proper 
authorization. The sender uses the electronic mail in the exercise of his/her 
work or by virtue thereof, and the institution accepts no liability for its 
undue use. If you have received this e-mail by mistake, please delete it 
immediately."

Reply via email to