首页 > 解决方案 > 当 Spring Boot 应用程序托管在远程 VM 中时,“Accept-Ranges”标头设置为“none”。在本地托管时设置为“字节”

问题描述

我有一个 Spring Boot 应用程序,它需要服务范围请求以恢复下载。当此 Spring Boot 应用程序托管在本地 Windows 机器中并且“Accept-Ranges”标头默认设置为“bytes”时,一切正常。但是,当相同的应用程序托管在运行 Windows 的远程虚拟机中时,“Accept-Ranges”标头默认设置为“none”,并且无法恢复下载。这里可能是什么问题?

>curl -I http://localhost:8080

HTTP/1.1 200
Accept-Ranges: bytes
Content-Type: application/json
Content-Length: 36121548
Date: Tue, 14 Sep 2021 13:00:19 GMT


>curl -I http://{IPofRemoteVM}:8080

HTTP/1.1 200
Accept-Ranges:  none
Content-Type: application/json
Content-Length: 36121548
Date: Tue, 14 Sep 2021 13:00:23 GMT

标签: javaspring-boothttphttp-headersaccept-ranges

解决方案


推荐阅读