Skip to content

Conversation

@siyuniums
Copy link

@siyuniums siyuniums commented Jul 28, 2022

Open Questions

1. Character encoding

  • what if one of the <head> tag characters is split across two bytes in some character encoding?
  • what if some character encoding translates a character to <h and we think it looks like the beginning of a head tag?

2. What if ServletOutputStream delegates to another ServletOutputStream?

Currently the instrumentation may inject the snippet twice.

Thoughts: Could use ThreadLocal to suppress duplicate injection?

Future Work

1. Content Type set after calling getOutputStream or getWriter

Currently, injection is not performed in this case.

Cases: static html and JSP
Possible solution: as soon as the content type is being set, create injection state and connect the
state to servlet out put stream and print writer

2. Support Netty

3. Support Servlet 5

4. Handle spaces in tag ex:< head >

5. Add tests for multibyte character encodings, e.g. Chinese

6. Send back traceId for the server request to the browser, so that you can associate the page to the original request

Thoughts: Splunk distro sends header back to the browser in Server-Timing header
a W3C draft proposal https://github.com/w3c/trace-context/blob/main/spec/21-http_response_header_format.md

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 28, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@trask
Copy link
Member

trask commented Jul 28, 2022

/easycla

@siyuniums siyuniums marked this pull request as ready for review August 3, 2022 01:44
@siyuniums siyuniums requested a review from a team August 3, 2022 01:44
@trask
Copy link
Member

trask commented Feb 14, 2023

closing in favor of #7650

@trask trask closed this Feb 14, 2023
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.

2 participants