Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stackoverflow error thrown by showcase's access control #48

Closed
balteo opened this issue May 9, 2012 · 6 comments
Closed

Stackoverflow error thrown by showcase's access control #48

balteo opened this issue May 9, 2012 · 6 comments

Comments

@balteo
Copy link

balteo commented May 9, 2012

Hi all,
It seems a stackoverflow error is thrown by the access control app.
I have attached the full JBoss 7 logs here: http://ocpsoft.org/support/topic/stackoverflow-error-thrown-by-showcases-access-control#post-3242
Regards,
Julien Martin.

@chkal
Copy link
Member

chkal commented May 13, 2012

Confirmed... Ups... I'll have a look...

chkal added a commit to chkal/rewrite that referenced this issue May 13, 2012
@chkal
Copy link
Member

chkal commented May 13, 2012

I just had a deeper look at this problem. This rule creates an endless forward:

.addRule(Join.path("/{global}").to("/{global}.xhtml")
.when(JodaTime.matches(timeGranted))
.withInboundCorrection())

It seems like /test is forwarded to /test.xhtml and is then forwarded to /test.xhtml.xhtml and then to /test.xhtml.xhtml.xhtml and so on.

I fixed this by changing the rule this way:

.addRule(Join.path("/{global}").to("/{global}.xhtml")
.when(JodaTime.matches(timeGranted).and(DispatchType.isRequest()))
.withInboundCorrection())

Please note the DispatchType.isRequest() in the when() part. This restricts the rule to don't match forwards anymore.

@lincolnthree: What do you think? Shouldn't Join already add a condition DispatchType.isRequest(). Or is there a usecase for Join to match on forwards? I'm not sure on this one.

@lincolnthree
Copy link
Member

Hmmm... yeah, that's a bad one. Strange I've never noticed this before. I think Join should probably use the addition you recomend. It's meant to be a convenience, not something that is confusing. If people need to intercept forwards, they should not use Join IMO.

@chkal
Copy link
Member

chkal commented May 14, 2012

OK, I'll create an issue for this.

@chkal
Copy link
Member

chkal commented May 14, 2012

I opened #51 for this. So I think this one can be closed.

@lincolnthree
Copy link
Member

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants