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

response is corrupted by app.java when converting byte[] to and from string in specific use case #182

Open
przemeqq opened this issue Nov 21, 2019 · 0 comments

Comments

@przemeqq
Copy link

Expected Behaviour

Ability to provide byte[] as response body in handler

Current Behaviour

In java12 template, you can't provide byte[] as response. You need to convert it to string in handler and in app.java it is again converted to byte[]. In result it gets corrupted. In our use case (generating pdf using JasperReports) we received blank PDFs

Possible Solution

Another template "Java12Byte" or changes to Java12
As workaround
(1) did custom template
(2 alternative ) encoded byte[] with base64 and decoded in client (unnecessary step)

Context

Some software eg JasperReports provides byte[] or outputstreams and they cannot be converted to String because they are getting corrupted (lost 2 workdays trying to understand cause).
I tried to use different encoding but it is not working. According to response in: https://community.jaspersoft.com/questions/976061/pdf-byte-array-encoding
it will not work.

Your Environment

  • Docker version docker version (e.g. Docker 17.0.05 ):
    19.03.4
  • Are you using Docker Swarm or Kubernetes (FaaS-netes)?
    Swarm
  • Operating System and version (e.g. Linux, Windows, MacOS):
    Windows, Linux, tried on both
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

1 participant