Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sake92
Copy link
Owner

@sake92 sake92 commented Mar 29, 2025

Fixes #18

@sake92 sake92 merged commit a4b077c into main Mar 29, 2025
2 checks passed
Comment on lines -84 to +92
exchange.getResponseSender.send(
Array(StandardCharsets.UTF_8.encode(s"<!DOCTYPE ${value.s}>"), StandardCharsets.UTF_8.encode(value.render))
)
exchange.getResponseSender.send(value.render)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks it since is not part of render

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually my code was wrong, since I wanted to do:

      exchange.getResponseSender.send(
        Array(StandardCharsets.UTF_8.encode(s"<!DOCTYPE ${value.s}>"), StandardCharsets.UTF_8.encode(value.content))
      )

The advantage is that it doesn't build a intermediate String.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your impl it returned doctype tag twice, see the tests.
I wouldnt microoptimize sharaf yet, at least not without perf tests

@sake92 sake92 deleted the add-inputstream-responsewritable branch May 13, 2025 10:59
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

Successfully merging this pull request may close these issues.

Support writing to java.io.OutputStream

3 participants