内容类型突然丢失
最近,在单独的 RedHat 5/Tomcat 6 服务器上运行的两个旧版 Struts 应用程序中出现了非常奇怪的问题。一些简要细节:
- 应用程序 1 是前端应用程序
- 应用程序 2 是一个辅助应用程序,用作文件存储库系统
- 应用程序 1 有一个上传表单,该表单转发到应用程序 2
- 应用程序 2 需要
multipart/form-data
上传时成为Content-Type
的一部分
上传会在一段时间内正常工作,但会突然失败。当我查看日志时,应用程序 2 报告 Content-Type
丢失,因此无法处理上传请求。而且,一旦丢失,就不会再出现。从那时起,所有上传尝试都将失败,更奇怪的是,解决该问题的唯一方法是重新启动托管应用程序 1 的 Tomcat,而不是应用程序 2。
其他奇怪
- 实现上传的代码一年多来,该功能没有发生变化
- 使用 Wireshark (tshark) 嗅探 TCP 数据包
- 在从 App1 发送的 HTTP 请求中正确填充内容类型
- 虽然 Wireshark 报告格式错误的数据包,但 App2 收到的 HTTP 请求中存在内容类型
您知道为什么会发生这种情况吗?
Really strange issue has been occurring lately with two legacy Struts applications running on separate RedHat 5/Tomcat 6 servers. Some brief details:
- App 1 is the front-facing application
- App 2 is an ancillary application which serves as a file repository system
- App 1 has an upload form which forwards to App 2
- App 2 expects
multipart/form-data
to be part of theContent-Type
when an upload occurs
Uploading will work fine for a while, but will all of a sudden fail. When I look in the logs, App 2 is reporting that the Content-Type
is missing and as such, cannot process the upload request. Furthermore, once it goes missing, it doesn't reappear. All attempts to upload will fail from that point forward and what's even more odd is that the only way to remedy the issue is to restart Tomcat hosting App 1, not App 2.
Other Oddities
- Code that implements the upload feature has not changed in over a year
- Using Wireshark (tshark) to sniff TCP packets
- The Content-Type properly populated on the HTTP Request being sent from App1
- Although Wireshark reports a malformed packet, the Content-Type is present on the HTTP Request received on App2
Any ideas why this could be happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑 App1 上存在某种状态更改,导致它不再使用对 App2 的请求中的 Content-Type 标头。如果没有看到代码,任何人都无法告诉您更多信息。
I would suspect there is some sort of state change on App1 which is causing it to no longer user the Content-Type header in requests to App2. Without seeing the code there is little more that anyone could tell you.