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 on HEAD request #86

Open
mstup opened this issue Jul 14, 2024 · 0 comments
Open

Response on HEAD request #86

mstup opened this issue Jul 14, 2024 · 0 comments

Comments

@mstup
Copy link

mstup commented Jul 14, 2024

Passed an exception in console in response on HEAD request.

WARNING: sendResponseHeaders: being invoked with a content length for a HEAD request
java.io.IOException: response headers not sent yet
	at jdk.httpserver/sun.net.httpserver.PlaceholderOutputStream.checkWrap(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.PlaceholderOutputStream.write(Unknown Source)
	at com.github.arteam.embedhttp.EmbeddedHttpServer.lambda$start$0(EmbeddedHttpServer.java:80)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$DefaultExecutor.execute(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.handle(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Dispatcher.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

For the HEAD request method, there should be no body in response (not empty string).
The "Content-Length" header should be able to specify by exact number and later should be not overwritten.

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