Questions tagged [http-headers]

In the Hypertext Transfer Protocol (HTTP), HTTP header fields contain the operating parameters of an HTTP request or response. With the request or response line (first line of message), they form the message header.

The header fields define various characteristics of the data transfer that is requested, or the data that is provided in the message body.

Header fields start with the field name, terminated with a colon character, followed by the field value. Field names and values may be any application-specific strings, but a core set of fields is standardized by the Internet Engineering Task Force (IETF) in RFC 2616 and other updates and extension documents (e.g. RFC 4229), and are commonly understood by all compliant protocol implementations.

Many parameters may be followed by a quality or 'q' value, giving a weight to use in content negotiation. The HTTP message header is separated from the message body by a blank line.

List of HTTP Header fields

11828 questions
5
votes
1 answer

Remove TraceParent header from HttpClient requests

When I send any requests with HttpClient, it automatically attaches the header TraceParent to the request headers. I tried clearing all the default request headers, but that didn't make a difference.
5
votes
2 answers

Exception thrown in end_request when adding headers

Occasoinally i get this exception thrown (viewable in elmah) System.Web.HttpException: Server cannot append header after HTTP headers have been sent. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an…
Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
5
votes
1 answer

Apache Caching JS CSS Files

I have enabled mod_cache, mod_expires, mod_headers modules in my httpd.conf and also added following text ExpiresActive On SetOutputFilter DEFLATE …
user704006
  • 271
  • 1
  • 5
  • 14
5
votes
2 answers

jersey.api.client.WebResource - how to debug/log the request headers

I am using jersey to generate http requests and I would like to be able to see the request before it is sent (for debugging purposes). For example: WebResource resource = client.resource(url); resource.header("aa", "bb"); resource.getHeaders(); //…
Shai Ben-Yehuda
  • 134
  • 1
  • 2
  • 8
5
votes
1 answer

apollo-server-lambda: Unable to determine event source based on event

I am using apollo-server-lambda for my app. I have create custom authoization http headers and it is required . if authoization: LETMEIN then it will return true and also return all data, if there is no any authoization or wrong authoization then it…
Krisna
  • 2,854
  • 2
  • 24
  • 66
5
votes
2 answers

HTTP Response with Content-Disposition doesn't trigger download

I use msw to mock backend responses for automated FE tests. I wanted to create an Export Functionality for user-created data. I am POSTing a Request to the desired route, and want to return a response with a .csv ; .pdf ; .xls file which should be…
D.Schaller
  • 611
  • 3
  • 19
5
votes
1 answer

Why is function http_response_code() acting strange that was called after function header() in PHP?

Well. I have a problem with http_response_code(), and I can't find an explanations. If I use header() before http_response_code(), PHP returns HTTP-status which was set by header() and ignores any http_response_code(). For example, I have a…
5
votes
1 answer

How can I prefix cookies with __Host or __Secure?

I am trying to add prefix to session cookies in rails 6.0.3 app but couldn't find a way to get it done. I have tried adding key to options hash in session store but it didn't help and breaks my application. I am using auth-logic gem for…
Arsii Rasheed
  • 324
  • 1
  • 5
  • 18
5
votes
3 answers

GZip compression in IIS7 not working, but content-encoding header is set to gzip

I have IIS 7.5 with static and dynamic compression enabled. It seems to work fine for dynamic files, but for static ones it behaves erratically, often sending a http header "Content-Encoding: gzip" when the content is not compressed. This causes…
user865984
  • 73
  • 1
  • 5
5
votes
3 answers

Why should we include CSP headers in the HTTP response for an API?

OWASP recommends to use Content-Security-Policy: frame-ancestors 'none' in API responses in order to avoid drag-and-drop style clickjacking attacks. However, the CSP spec seems to indicate that after the HTML page is loaded any other CSP rules in…
5
votes
4 answers

How to quote strings for use in HTTP header fields?

TL;DR: Given an arbitrary filename as a Go string value, what's the best way to create a Content-Disposition header field that specifies that filename? I'm writing a Go net/http handler, and I want to set the Content-Disposition header field to…
5
votes
1 answer

Is the Expect-CT HTTP header still relevant in 2021?

We recently had a penetration test performed on our site and one of the recommendations was to implement the Expect-CT HTTP response header: It is recommended to implement the Expect-CT header. A sensible setting for testing would be the…
HappyDog
  • 1,230
  • 1
  • 18
  • 45
5
votes
2 answers

content-length header from php is overwritten !

I'm trying to figure why the Content-Length header of php gets overwritten. This is demo.php a request to fetch the headers curl -I http://someserver.com/demo.php HTTP/1.1 200 OK Date: Tue, 19 Jul…
Michael
  • 51
  • 2
5
votes
2 answers

Get request headers in HttpInterceptor in Angular

I have an Angular app in production. Its http requests are wrapped with environment headers so I would like to get all request headers to extract some useful info. If I use proxy server in development then the task is simple. I just create…
Артур Гудиев
  • 1,004
  • 2
  • 10
  • 26
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