You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2018/07/22 16:47:00 UTC

[jira] [Resolved] (WICKET-6568) Wicket fails / does not encode request header values in AjaxCalls

     [ https://issues.apache.org/jira/browse/WICKET-6568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-6568.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 9.0.0
                   8.1.0
                   7.11.0

We might decide to decode all header values later. But for now only "Wicket-FocusedElementId"  is decoded, since we know wicket-ajax-jquery encodes it before setting the header.

Thanks Torsten!

> Wicket fails / does not encode request header values in AjaxCalls
> -----------------------------------------------------------------
>
>                 Key: WICKET-6568
>                 URL: https://issues.apache.org/jira/browse/WICKET-6568
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.7.0
>            Reporter: Torsten Krah
>            Assignee: Sven Meier
>            Priority: Major
>              Labels: UTF-8, ajax, encode, header
>             Fix For: 7.11.0, 8.1.0, 9.0.0
>
>
> Looking at:
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js?source
> Wicket just sets the Wicket-FocusedElementId header to the id of the element.
> However according to:
> http://w3c.github.io/html/single-page.html#element-attrdef-global-id
> The id must not contain a space, other UTF-8 characters are allowed.
> {quote}
> When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element’s tree and must contain at least one character. The value must not contain any space characters.
> {quote}
> We got UTF-8 characters in our ids - now wicket fails to make Ajax calls with e.g. this error:
> {code}
> ERROR: Wicket.Ajax.Call.failure: Error while parsing response: TypeError: Cannot convert string to ByteString because the character at index 64 has value 328 which is greater than 255.
> {code}
> Because the Header value set in the code:
> {code}
> if (Wicket.Focus.lastFocusId) {
>     headers["Wicket-FocusedElementId"] = Wicket.Focus.lastFocusId;
> }
> {code}
> has to be encoded and decoded on the backend (either base64, url encoding or something else which is allowed to be in a header).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)