OpenShift:Access-Control-Allow-服务器为GET请求设置的原点在路返回时消失 [英] OpenShift: Access-Control-Allow-Origin set by server for GET request disappears on way back

查看:246
本文介绍了OpenShift:Access-Control-Allow-服务器为GET请求设置的原点在路返回时消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenShift上遇到了一个奇怪的行为。我在OpenShift上运行启用了CORS过滤器的REST应用程序来设置Access-Control-Allow-Origin头。这对于所有请求的本地jboss和对于GET以外的所有请求的OpenShift都可以正常工作。

I've run into a strange behavior on OpenShift. I run a REST application on OpenShift which have CORS Filter enabled to set Access-Control-Allow-Origin header. This works fine on local jboss for all requests and on OpenShift for all requests but GET.

由于某些原因,当GET请求发出后发生。 Jbossas接收请求,应用程序设置Access-Control-Allow-Origin头(这是通过远程调试验证的)。但是我在主叫方接收的响应不包含头。

For some reason when GET request is issued following happens. Jbossas receives a request and application sets the Access-Control-Allow-Origin header (this was verified with remote debugging). But the response I'm receiving on the caller side contains no header. Something along the way back removes the header.

可以是什么原因或如何修复它?

What can be the reason or how to fix it?

推荐答案

在OpenShift在线的http请求通过反向代理(apache),所以有可能当通过代理返回的头被删除。

http requests to gears on OpenShift Online go through a reverse proxy (apache), so it is possible that header is being removed when it comes back through the proxy.

这篇关于OpenShift:Access-Control-Allow-服务器为GET请求设置的原点在路返回时消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆