ServletUtils#createHTTPRequest fail on Jetty when parameter API has been previously called on application/x-www-form-urlencoded request

Issue #186 resolved
Thomas Mortagne created an issue

My workaround in #184 works well in Tomcat but Jetty does not like getting a call to getReader() after a call to getInputStream() (which is what it's using internally to read the content when parsing the parameters).

A safer fix would be to always recreate the content based on parameters in case of application/x-www-form-urlencoded request so that we don't end up with an exception when trying to read unreadable content.

Pull request coming.

Comments (5)

  1. Thomas Mortagne reporter

    https://bitbucket.org/connect2id/oauth-2.0-sdk-with-openid-connect-extensions/pull-requests/11/issue-186-servletutils-createhttprequest/diff

    It's a change in the logic. I can understand if you don't like it unfortunately I don't control the code calling Servlet request parameter API executed before mine (I'm writing an extension).

    (I can always hack something on my side but I tough this was not so bad and could reduce a bit the WTF effect for people checking some parameters before creating the oidc request).

  2. Connect2id OSS

    For now this change appears to make good sense. Just pushed v5.9.1 with the patch that you submitted.

    Please confirm the issue has been fixed on your side by closing it.

    Thanks,

  3. Log in to comment