Rest 端点仅在 Windows 上挂起。其他端点工作
Rest endpoint hangs on Windows only. Other endpoints work
所以...这是一个非常奇怪的问题,我很难弄明白。
我使用 Wildfly 部署了一个应用程序。这是一个 spring 引导 java 应用程序与休息端点。
使用 Ubuntu+chrome 访问应用程序时运行良好,但在 Windows+chrome+firefox(在 4 台不同的机器上测试)中有一个特定的"hangs" 的端点。查看 chrome 开发者控制台时,它处于 PENDING 状态。直接用浏览器地址栏访问端点也挂了没有反应。
有问题的端点是 /auth
这是控制器:
@RestController
@RequestMapping("${base.url}")
public class MyController {
@GetMapping("/auth")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void validateAuthentication() {
// nothing
}
@GetMapping("/now")
@ResponseStatus(HttpStatus.OK)
public SimpleDateOutput fetchCurrentDate() {
return SimpleDateOutput.of(new Date());
}
}
此外,“/now”端点也有效。
我们有另一个不同的服务器 运行 一个 嵌入式 tomcat,并且在两个操作系统中都可以正常工作。
所以,我在这里真的很茫然。有人见过这么奇怪的行为吗?
尝试更改为 HttpStatus.OK
,也许会有帮助。
所以...这是一个非常奇怪的问题,我很难弄明白。
我使用 Wildfly 部署了一个应用程序。这是一个 spring 引导 java 应用程序与休息端点。
使用 Ubuntu+chrome 访问应用程序时运行良好,但在 Windows+chrome+firefox(在 4 台不同的机器上测试)中有一个特定的"hangs" 的端点。查看 chrome 开发者控制台时,它处于 PENDING 状态。直接用浏览器地址栏访问端点也挂了没有反应。
有问题的端点是 /auth
这是控制器:
@RestController
@RequestMapping("${base.url}")
public class MyController {
@GetMapping("/auth")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void validateAuthentication() {
// nothing
}
@GetMapping("/now")
@ResponseStatus(HttpStatus.OK)
public SimpleDateOutput fetchCurrentDate() {
return SimpleDateOutput.of(new Date());
}
}
此外,“/now”端点也有效。
我们有另一个不同的服务器 运行 一个 嵌入式 tomcat,并且在两个操作系统中都可以正常工作。
所以,我在这里真的很茫然。有人见过这么奇怪的行为吗?
尝试更改为 HttpStatus.OK
,也许会有帮助。