Hi Ben, 

thank you for the commit. 

Cheers, 
Bob 

Roberto Marotta 
D.B.M. Srl 
Via Enrico Noe, 23 
20133 Milano 
Tel. 02.26.60.05.21 


----- Original Message -----

From: "Ben Weidig" <b...@netzgut.net> 
To: "Tapestry users" <users@tapestry.apache.org> 
Sent: Monday, 9 May, 2022 5:56:47 PM 
Subject: Re: ChecksumPath exception on unexistent assets 

Hi Bob, 

thanks for the patch! 
I've changed it to an early return to don't check for -1 again, and added 
some tests. 

https://github.com/apache/tapestry-5/commit/b01906961a456656404fc2bc9d85ea2aeff10c53
 

Cheers, 
Ben 

On Mon, May 9, 2022 at 3:57 PM Roberto <robe...@dbmsrl.com> wrote: 

> Hi Ben, 
> 
> a possible solution for TAP5-2713 (ChecksumPath: 
> java.lang.StringIndexOutOfBoundsException) ticket could be this: 
> 
> In 'ChecksumPath' method only check 'slashx' variable and if it is -1 
> return NON_EXISTING_RESOURCE, otherwise it executes the normal code. 
> 
> The patch is in attached. 
> 
> Regards, 
> Bob 
> 
> Roberto Marotta 
> D.B.M. Srl 
> Via Enrico Noe, 23 
> 20133 Milano 
> Tel. 02.26.60.05.21 
> 
> 
> ------------------------------ 
> *From: *"Ben Weidig" <b...@netzgut.net> 
> *To: *"Tapestry users" <users@tapestry.apache.org> 
> *Sent: *Monday, 28 March, 2022 4:30:28 PM 
> *Subject: *Re: ChecksumPath exception on unexistent assets 
> 
> Hi Bob, 
> 
> thanks for informing us about the exception on non-existant resources, 
> I've created an issue: https://issues.apache.org/jira/browse/TAP5-2713 and 
> will take a look. 
> 
> Cheers, 
> Ben 
> 
> 
> On Mon, Mar 28, 2022 at 4:15 PM Roberto <robe...@dbmsrl.com> wrote: 
> 
> > 
> > 
> > Hi, 
> > 
> > It appears that the 
> > "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws 
> > exception 
> > like "String index out of range: -1" when trying to apply substring 
> > function on unexistent resource path. 
> > Maybe throwing an exception like "404 code error and resource not found" 
> > would be more convenient. 
> > 
> > kind regards 
> > bob 
> > 
> > 
> > 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org 
> For additional commands, e-mail: users-h...@tapestry.apache.org 

Reply via email to