HttpRewriteWrappedResponse cannot handle Transformer

Splash Forums Rewrite Users HttpRewriteWrappedResponse cannot handle Transformer


This topic contains 3 replies, has 2 voices, and was last updated by  Lincoln Baxter III 7 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #26697


    I am trying to pass the response from an incomming stream through a Transforer (to convert href’s)
    This fails because the response comes from a “”

    I have a suggestion to improve the IllegalStateException 10 grams.
    I have added the request.getRequestURI() to a formatted string.

       public void addContentInterceptor(ResponseContentInterceptor stage) throws IllegalStateException
          if (areStreamsLocked())
             throw new IllegalStateException(
                          "Cannot add output buffers to Response %s once request processing has been passed to the application."

    My code is: (dmi is just a sample, I have nothing to do with that company)

       .perform("").and(Transform.with(new HrefTransformer())))

    Currently I understand that Transform cannot be after ..


    Hi! Thank you for your suggestion. Would you mind sending a pull request for that?

    Also, have you tried adding the transformer before performing the proxy operation?

       .perform(Transform.with(new HrefTransformer()).and("")))

    I believe this might resolve the error entirely.



    Hi Lincoln
    I have made a pull request with the change.
    I made in “master” branch the sender is “anderskristian”
    it is a small thing, but it was nice to try this pull thing out…
    Maybe I get the HrefTransformer working… so I can make pull request for that one…

    Yes swapping the Transform and Proxy did work !!!
    I made an internal test with own “sub-web” that worked fine 🙂

    But does not work, seems to send compressed….
    The StringTransformer cannot handle as well.

    Maybe I will ignore that problem, I am not going to proxy to external pages anyway. But understanding the problem could be nice.


    Yeah. I’m not really sure that you want to be using the Transformer API if you have any binary content. It was really intended for rendering documents from markdown, or changing text formats. The ResponseContentInterceptor or ResponseStreamInterceptor might be more what you are looking for?

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.