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

Test captured HTTP headers - HTTP server tests, part 1 #4320

Conversation

mateuszrzeszutek
Copy link
Member

I've added a new test case in HttpServerTest just for testing the captured headers; this test is enabled in some Spring boot test (javaagent instrumentation) and Restlet (library instrumentation). I'll enable it in all other tests in the next PR.

testLibrary("io.undertow:undertow-servlet:1.0.0.Final")
testLibrary("io.undertow:undertow-servlet:1.4.28.Final")
Copy link
Member

Choose a reason for hiding this comment

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

Undertow 1.0 had a bug where it thrown NPE on getHeaders()

😱

Copy link
Member Author

Choose a reason for hiding this comment

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

    public Collection<String> getHeaders(String name) {
        return new ArrayList(this.exchange.getResponseHeaders().get(name));
    }

Guess what happens when this.exchange.getResponseHeaders() returns null because there are no headers in the response yet 🙈

@trask trask merged commit 581a5e3 into open-telemetry:main Oct 7, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the test-captured-http-headers-server-part-1 branch October 8, 2021 07:05
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