用反应器提供静态内容物

时间:2016-11-28 13:56:28

标签: java netty project-reactor

我想让我的reactor-service公开一些带有状态信息的静态html。 projectreactor.io使用reactor-netty,它非常适合提供单个独立文件:

HttpServer http = HttpServer.create("0.0.0.0", 8100);
http.directory("/static", someLocalPath);
http.start().subscribe();

但是很快,当html引用另一个文件时,对引用文件的请求在浏览器中保持挂起状态,并且永远不会完成。 例如。 index.html包含以下内容:

<html><body>
    <img src="http://localhost:8100/static/small.jpg" />
</body></html>

此处浏览器显示index.html的状态200和状态&#34;待定&#34; for small.jpg

直接请求small.jpg没有问题。

我做错了什么?

1 个答案:

答案 0 :(得分:1)

这是反应堆网络的0.5.1.RELEASE中的一个错误 它固定在0.5.2.RELEASE。

感谢SimonBaslé@ reactor

相关问题