[ 
https://issues.apache.org/jira/browse/MYFACES-4703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17936808#comment-17936808
 ] 

Melloware edited comment on MYFACES-4703 at 3/19/25 12:32 PM:
--------------------------------------------------------------

OK I see you ran the wrong test on 4.0.3.   I will revert this change????


was (Author: melloware):
OK I see you ran the wrong test on 4.0.3.   I will revert this change.

> Infinite Redirect Loop if invalid Accept header
> -----------------------------------------------
>
>                 Key: MYFACES-4703
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4703
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 4.0.2, 4.1.0
>            Reporter: Melloware
>            Assignee: Melloware
>            Priority: Major
>             Fix For: 5.0.0, 4.0.3, 4.1.1
>
>
> Original PrimeFaces Issue: 
> https://github.com/primefaces/primefaces/issues/13104
> IF you hit a MyFaces app using PrimeFaces and the Content-Type is invalid it 
> gets in an infinite redirect loop if you have an `error-page` mapped.
> {noformat}
> Dec 21, 2024 10:09:19 AM 
> org.primefaces.application.exceptionhandler.PrimeExceptionHandler logException
> SEVERE: ContentTypeList does not contain a supported content type: text/plain
> java.lang.IllegalArgumentException: ContentTypeList does not contain a 
> supported content type: text/plain
>         at 
> org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.createResponseWriter(HtmlRenderKitImpl.java:311)
>         at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createResponseWriter(FaceletViewDeclarationLanguage.java:2116)
>         at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1751)
>         at 
> org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:316)
>         at 
> jakarta.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:74)
>         at 
> jakarta.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:74)
>         at 
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:122)
>         at 
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
>         at 
> jakarta.faces.lifecycle.LifecycleWrapper.render(LifecycleWrapper.java:43)
>         at jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:225)
> {noformat}
> 1. Simply run the Showcase using MyFaces 4.0
> 2. Execute `curl` or `PowerShell` to hit the site with an invalid 
> Content-Type.
> {code:bash}
> $response = Invoke-WebRequest -Uri 
> "http://localhost:8080/showcase/ui/ajax/process.xhtml"; -Method GET -Headers 
> @{ Accept = "text/plain" } -AllowInsecureRedirect
> {code}
> 3. Because it gets the error it tries to redirect to `/showcase/error.xhtml` 
> using `externalContext.redirect(url);`.  This however just generates the same 
> error in MyFaces in an infinite loop.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to