Hi
I managed to figure out what is happening. I needed to add another CORS header to be able to see it. I am not sure it is really an issue with swagger, but CORS is new to me so I am not sure.
I read this
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS and then tried adding:
res.addHeader("Access-Control-Expose-Headers", "Location");
to my servlet filter that adds the extra headers on and it now shows up in the response header section:
{
"Location": "http://<correct URL>",
"Content-Type": "application/json;charset=UTF-8"
}
For reference this is how I am setting up my CORS stuff on glassfish now:
public class HTML5CorsFilter implements javax.servlet.Filter {
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletResponse res = (HttpServletResponse) response;
res.addHeader("Access-Control-Allow-Origin", "*");
res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
res.addHeader("Access-Control-Allow-Headers", "Content-Type");
res.addHeader("Access-Control-Expose-Headers", "Location");
chain.doFilter(request, response);
}
...
If you still think there is an issue here let me know and I can create one for you.
Thank you very much for your help, with out you asking be to do all of that I would not have realised what was going on.
Also thanks for the note about running locally.
Regards,
Dan.