Questions tagged [response-headers]

545 questions
7
votes
1 answer

Javascript won't set httpcookie received in XHR response

I have a basic SPA (react) <-> API (net core 2.2) setup, with 2 environments: dev and prod (small project). There is an authentication mechanism on the API side that checks the presence of a httponly cookie in every request containing a JWT. On the…
7
votes
2 answers

Set response header in Spring Boot

How can I set the response header for each call in my application made with Spring Boot? I would like to try to use a filter to intercept all the calls and be able to set the response header. I followed the guide Disable browser caching HTML5, but…
7
votes
0 answers

Setting HTTP response headers application-wide in Rails 3.2

How do I set response headers application-wide in Rails 3.2? The Rails guides to security for 4.0 mentions config.action_dispatch.default_headers: 8 Default Headers Every HTTP response from your Rails application receives the following default…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
7
votes
1 answer

How to read response headers with $resource?

I'm using $resource to get data from my RESTful service and I need to read response headers to get 'X-Page' and 'X-Total-Pages' value for pagination. Example: Access-Control-Max-Age:1728000 Cache-Control:max-age=0, private,…
HNQ
  • 110
  • 2
  • 9
7
votes
2 answers

Setting response header with javascript

I'm having troubles with collecting json values from a URL in my application. When I try to get them a error log is displayed in the console saying that origin is not allowed by access-control-allow-origin. I researched a bit and found out that…
Marko Ćilimković
  • 734
  • 1
  • 8
  • 22
7
votes
3 answers

PHP: header expires not working

My PHP code: $expires_date = date('D, j F Y H:i:s', strtotime('now + 10 years')) . ' GMT'; header("Expires: $expires_date"); header('Content-type: text/javascript'); echo 'hello world'; When I check the response headers, I see…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
6
votes
1 answer

How to get response header from useQuery of Apollo Client

I haven't been able to find a way to do this at all. Does anyone know if this is supported? Thanks.
His
  • 5,891
  • 15
  • 61
  • 82
6
votes
0 answers

preserve order of http response headers golang

Anyone know of a way to preserve the order of response headers received using the net/http package? As it is, the headers are accessible only as a map[string]string and iterating over them does not preserve order. Any input would be much…
brun
  • 133
  • 9
6
votes
2 answers

Remove duplicate "Set-Cookie" header from PHP response

This is an example script from a larger application, but shows the general process of what I'm trying to do. If I have the following script:
WOUNDEDStevenJones
  • 5,150
  • 6
  • 41
  • 53
6
votes
4 answers

extract both JSON and headers from fetch()

I am modelling the auth layer for a simple react/redux app. On the server side I have an API based on the devise_token_auth gem. I am using fetch to post a sign in request: const JSON_HEADERS = new Headers({ 'Content-Type':…
nerfologist
  • 761
  • 10
  • 23
6
votes
0 answers

nginx proxy_pass check upstream content type

I want to give a simple 403 forbidden error if source server return application/vnd.error+json for content type. Here is my code: server { root /var/www/; recursive_error_pages on; location / { proxy_pass …
5
votes
1 answer

upper case converted to lower case when reading response HEADER in node/express js with httpclients axios and request-promise

In my application(node/express), I have to call a third party server to read some data. The response of the third party server will have custom header sessionId - Id being capitalized as per the document. But in my application, the custom header key…
Manikandan J
  • 144
  • 1
  • 6
5
votes
2 answers

GraphQL: Cannot read response headers in Apollo Client

I would like to read a response header with Apollo Client and I cannot. I'm using Apollo server and Apollo client for GraphQL API communication, and I would like to send headers back and forth. I've set up the client so that it sends a…
AlbertoPL
  • 11,479
  • 5
  • 49
  • 73
5
votes
1 answer

Removing header from cached response with NGINX

I have NGINX running as a reverse proxy in front of a few Flask apps. I want to implement caching for logged out users. Flask-login adds a Set-Cookie header for every response, even for anonymous users, as it contains a session cookie with a CSRF…
Chris Wynne
  • 251
  • 3
  • 7
5
votes
2 answers

Content-Disposition inline filename issue with IE

I am displaying a pdf in browser with inline from API using an aspx page. While saving the pdf using Chrome/Firefox, takes the filename from header("Content-Disposition", "inline;filename=xyz.pdf") But while saving the pdf using IE it does not reads…
Ragavan
  • 51
  • 1
  • 1
  • 2
1 2
3
36 37