You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/07/19 19:32:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16549734#comment-16549734 ] 

ASF subversion and git services commented on WICKET-6568:
---------------------------------------------------------

Commit ac85c32f4c001b3c4c06a5d94bd1ff6ab8d4acae in wicket's branch refs/heads/wicket-7.x from [~svenmeier]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=ac85c32 ]

WICKET-6568 escape header "Wicket-FocusedElementId"

it might contain non-ASCII

> 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
>
> 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)