You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2015/01/09 13:50:46 UTC

AtmosphereBehavior - possible invalid callback URL

Hi,

Inside AtmosphereBehavior method getCallbackUrl() return value is calculated as:

        return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX + "=true&" +
                  WebRequest.PARAM_AJAX_BASE_URL + "=.";

Is it correct? When atmosphere update contains some resources (css,
js) their paths are invalid encoded because
WebRequest.PARAM_AJAX_BASE_URL is set to ".".
Maybe this parameter should be encoded the same way as in
AbstractDefaultAjaxBehavior:

        RequestCycle requestCycle = component.getRequestCycle();
        Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
        CharSequence ajaxBaseUrl = Strings.escapeMarkup(baseUrl.toString());

In my test case this solves a problem.

--
Best regards,
Daniel

Re: AtmosphereBehavior - possible invalid callback URL

Posted by Martin Grigorov <mg...@apache.org>.
I've already fixed it earlier today
On Jan 19, 2015 4:52 PM, "Daniel Stoch" <da...@gmail.com> wrote:

> WICKET-5813
>
> --
> Daniel
>
> On Sun, Jan 11, 2015 at 9:50 PM, Martin Grigorov <mg...@apache.org>
> wrote:
> > Daniel,
> >
> > Please create a ticket.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Jan 9, 2015 at 2:44 PM, Emond Papegaaij <
> emond.papegaaij@topicus.nl>
> > wrote:
> >
> >> You wrote that code :) I think he is right.
> >>
> >> Best regards,
> >> Emond
> >>
> >> On Friday 09 January 2015 14:34:14 Martin Grigorov wrote:
> >> > Sounds reasonable to me.
> >> > Emond ?
> >> >
> >> > Martin Grigorov
> >> > Wicket Training and Consulting
> >> > https://twitter.com/mtgrigorov
> >> >
> >> > On Fri, Jan 9, 2015 at 1:50 PM, Daniel Stoch <da...@gmail.com>
> >> wrote:
> >> > > Hi,
> >> > >
> >> > > Inside AtmosphereBehavior method getCallbackUrl() return value is
> >> > >
> >> > > calculated as:
> >> > >         return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX
> +
> >> > >
> >> > > "=true&" +
> >> > >
> >> > >                   WebRequest.PARAM_AJAX_BASE_URL + "=.";
> >> > >
> >> > > Is it correct? When atmosphere update contains some resources (css,
> >> > > js) their paths are invalid encoded because
> >> > > WebRequest.PARAM_AJAX_BASE_URL is set to ".".
> >> > > Maybe this parameter should be encoded the same way as in
> >> > >
> >> > > AbstractDefaultAjaxBehavior:
> >> > >         RequestCycle requestCycle = component.getRequestCycle();
> >> > >         Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
> >> > >         CharSequence ajaxBaseUrl =
> >> > >
> >> > > Strings.escapeMarkup(baseUrl.toString());
> >> > >
> >> > > In my test case this solves a problem.
> >> > >
> >> > > --
> >> > > Best regards,
> >> > > Daniel
> >>
> >>
>

Re: AtmosphereBehavior - possible invalid callback URL

Posted by Daniel Stoch <da...@gmail.com>.
WICKET-5813

--
Daniel

On Sun, Jan 11, 2015 at 9:50 PM, Martin Grigorov <mg...@apache.org> wrote:
> Daniel,
>
> Please create a ticket.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Jan 9, 2015 at 2:44 PM, Emond Papegaaij <em...@topicus.nl>
> wrote:
>
>> You wrote that code :) I think he is right.
>>
>> Best regards,
>> Emond
>>
>> On Friday 09 January 2015 14:34:14 Martin Grigorov wrote:
>> > Sounds reasonable to me.
>> > Emond ?
>> >
>> > Martin Grigorov
>> > Wicket Training and Consulting
>> > https://twitter.com/mtgrigorov
>> >
>> > On Fri, Jan 9, 2015 at 1:50 PM, Daniel Stoch <da...@gmail.com>
>> wrote:
>> > > Hi,
>> > >
>> > > Inside AtmosphereBehavior method getCallbackUrl() return value is
>> > >
>> > > calculated as:
>> > >         return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX +
>> > >
>> > > "=true&" +
>> > >
>> > >                   WebRequest.PARAM_AJAX_BASE_URL + "=.";
>> > >
>> > > Is it correct? When atmosphere update contains some resources (css,
>> > > js) their paths are invalid encoded because
>> > > WebRequest.PARAM_AJAX_BASE_URL is set to ".".
>> > > Maybe this parameter should be encoded the same way as in
>> > >
>> > > AbstractDefaultAjaxBehavior:
>> > >         RequestCycle requestCycle = component.getRequestCycle();
>> > >         Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
>> > >         CharSequence ajaxBaseUrl =
>> > >
>> > > Strings.escapeMarkup(baseUrl.toString());
>> > >
>> > > In my test case this solves a problem.
>> > >
>> > > --
>> > > Best regards,
>> > > Daniel
>>
>>

Re: AtmosphereBehavior - possible invalid callback URL

Posted by Martin Grigorov <mg...@apache.org>.
Daniel,

Please create a ticket.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Jan 9, 2015 at 2:44 PM, Emond Papegaaij <em...@topicus.nl>
wrote:

> You wrote that code :) I think he is right.
>
> Best regards,
> Emond
>
> On Friday 09 January 2015 14:34:14 Martin Grigorov wrote:
> > Sounds reasonable to me.
> > Emond ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Jan 9, 2015 at 1:50 PM, Daniel Stoch <da...@gmail.com>
> wrote:
> > > Hi,
> > >
> > > Inside AtmosphereBehavior method getCallbackUrl() return value is
> > >
> > > calculated as:
> > >         return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX +
> > >
> > > "=true&" +
> > >
> > >                   WebRequest.PARAM_AJAX_BASE_URL + "=.";
> > >
> > > Is it correct? When atmosphere update contains some resources (css,
> > > js) their paths are invalid encoded because
> > > WebRequest.PARAM_AJAX_BASE_URL is set to ".".
> > > Maybe this parameter should be encoded the same way as in
> > >
> > > AbstractDefaultAjaxBehavior:
> > >         RequestCycle requestCycle = component.getRequestCycle();
> > >         Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
> > >         CharSequence ajaxBaseUrl =
> > >
> > > Strings.escapeMarkup(baseUrl.toString());
> > >
> > > In my test case this solves a problem.
> > >
> > > --
> > > Best regards,
> > > Daniel
>
>

Re: AtmosphereBehavior - possible invalid callback URL

Posted by Emond Papegaaij <em...@topicus.nl>.
You wrote that code :) I think he is right.

Best regards,
Emond

On Friday 09 January 2015 14:34:14 Martin Grigorov wrote:
> Sounds reasonable to me.
> Emond ?
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Fri, Jan 9, 2015 at 1:50 PM, Daniel Stoch <da...@gmail.com> wrote:
> > Hi,
> > 
> > Inside AtmosphereBehavior method getCallbackUrl() return value is
> > 
> > calculated as:
> >         return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX +
> > 
> > "=true&" +
> > 
> >                   WebRequest.PARAM_AJAX_BASE_URL + "=.";
> > 
> > Is it correct? When atmosphere update contains some resources (css,
> > js) their paths are invalid encoded because
> > WebRequest.PARAM_AJAX_BASE_URL is set to ".".
> > Maybe this parameter should be encoded the same way as in
> > 
> > AbstractDefaultAjaxBehavior:
> >         RequestCycle requestCycle = component.getRequestCycle();
> >         Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
> >         CharSequence ajaxBaseUrl =
> > 
> > Strings.escapeMarkup(baseUrl.toString());
> > 
> > In my test case this solves a problem.
> > 
> > --
> > Best regards,
> > Daniel


Re: AtmosphereBehavior - possible invalid callback URL

Posted by Martin Grigorov <mg...@apache.org>.
Sounds reasonable to me.
Emond ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Jan 9, 2015 at 1:50 PM, Daniel Stoch <da...@gmail.com> wrote:

> Hi,
>
> Inside AtmosphereBehavior method getCallbackUrl() return value is
> calculated as:
>
>         return super.getCallbackUrl() + "&" + WebRequest.PARAM_AJAX +
> "=true&" +
>                   WebRequest.PARAM_AJAX_BASE_URL + "=.";
>
> Is it correct? When atmosphere update contains some resources (css,
> js) their paths are invalid encoded because
> WebRequest.PARAM_AJAX_BASE_URL is set to ".".
> Maybe this parameter should be encoded the same way as in
> AbstractDefaultAjaxBehavior:
>
>         RequestCycle requestCycle = component.getRequestCycle();
>         Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl();
>         CharSequence ajaxBaseUrl =
> Strings.escapeMarkup(baseUrl.toString());
>
> In my test case this solves a problem.
>
> --
> Best regards,
> Daniel
>