http-headers

Removing the “Date” http response header on IIS 7+

孤街醉人 提交于 2019-12-07 05:23:59
问题 I am developing an ASP.NET Web API application which responds to the clients with a custom datetime http header. While I have read several articles describing how to remove response headers from ASP.NET/IIS, this one always seem to be resilient, i can't get rid of it. It seems to be placed in the response pipeline somewhere out of the programmer's/administrator's control, at the very end. I know it may be a bad practice not to include the "Date" header in the response but, as i mentioned, the

Dealing with incorrect HTTP header body size values?

ⅰ亾dé卋堺 提交于 2019-12-07 05:18:11
问题 Using C# ASP.NET MVC, when calling a webservice on a Magento site: Sometimes a Magento site will send wrong HTTP headers, specifically the body-size header saying that the body is bigger than it really is. For example it might say body-size=1000, but the body only consists of 999 bytes. Despite the header being incorrect, the body is correct so I would still like to be able to process it. Now when I try to read that response in C# var invoiceInfo = _magentoService.salesOrderInvoiceInfo

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

无人久伴 提交于 2019-12-07 04:38:43
问题 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(); // Error: how can I do it? thanks 回答1: You can use LoggingFilter, as shown here 回答2: You need to add init-params and then implement ContainerRequestFilter Put it in your web.xml Please note that com.az.jersey.server.AuthFilter is your class that has

Multiple distinct Content-Disposition headers received from server in Jasperreports

旧时模样 提交于 2019-12-07 03:19:35
问题 I'm trying to set content-disposition header in response of servlet, but i get this error in browser. What should i do? Duplicate headers received from server The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue. Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to

How to prevent HttpClient from sending the Connection header

房东的猫 提交于 2019-12-07 02:28:42
问题 HttpClient includes this as 'Keep-Alive' by default. I've been able to set it to 'Close' using httpClient.DefaultRequestHeaders.ConnectionClose = true; but how do I omit it altogether? 回答1: I've seen this asked before and to my knowledge no one (not even the great Jon Skeet) has come up with a way to avoid sending the Connection header in the HttpClient or HttpWebRequest worlds without completely reinventing the wheel. It's happening somewhere very deep down in the weeds. ConnectionClose is

HTTP response headers: multiple Link values

半城伤御伤魂 提交于 2019-12-07 02:05:35
问题 I'm working on SEO for a Rails App. The website is fully localized, and I'm following this google article to add hreflang alternate links to the pages. The HTML links in the <head> are ok. I'm having some troubles with the response headers. I understand that I'm supposed to provide values for each alternative version of the page, but I'm not sure about how to set multiple values. I tried to pass them as a comma separated list . Browsers seem to receive it correctly, but since individual

PHP header() call “crashing” script with HTTP 500 error [duplicate]

与世无争的帅哥 提交于 2019-12-07 02:03:29
This question already has answers here : header(“location”) causes [500] internal server error? (4 answers) Closed last year . I use PHP 5.2.9. To see/log errors, at the beggining of my script I have: error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 'On'); ini_set('log_errors', 'On'); ini_set('error_log', $_SERVER['DOCUMENT_ROOT'] . '/php.log'); But when I use the first of the next two lines, my script issue a HTTP 500 error, and nothing is displayed (except the 500 error) and nothing is logged in my php.log. If I use the second line instead of the first one, all is OK and the 304

Duplicated “set-cookie: ci-session” fields in header by codeigniter

筅森魡賤 提交于 2019-12-07 02:02:39
问题 For each time $this->session->set_userdata() or $this->session->set_flashdata() is used in my controller, another identical "Set-Cookie: ci_session=..." is added to the http header the server sends. Multiple Set-Cookie fields, with the same cookie name, in the http header is not okay according to rfc6265. So is there a way to use codeigniter sessions without it creating multiple identical "set-cookie:"s? (I've used curl to verify the http header) 回答1: check https://github.com/EllisLab

How to return response header field to main method using Google Volley for HTTP GET request in Android / Java?

[亡魂溺海] 提交于 2019-12-07 01:15:27
问题 I'm using google volley for networking in android. I will make a http GET request and need to return a response header value. I found some answers on stack overflow to access the header fields, but don't know how to return it to my calling spot. Please have a look at my code, I put four numbers in it to explain my problem. At (1) I can print out the value which I need. Than I've tried to save it in a class attribute (2) and there is no error in the IDE. If I want to return it from there (3),

AWS API signed POST request with Javascript

守給你的承諾、 提交于 2019-12-07 00:52:27
What I'm trying to do: Ultimately: I want to populate an AWS Kinesis stream from a browser extension (Safari, Chrome). I need to send the request to AWS using a signing process (v4); this involves setting headers and encrypting them (on a distant server with the aws secret key) to finally join those to the request. Amazon requests the header "Host" to be explicitly defined… However Javascript strictly disallow setting it (and a bunch of others, for good reasons) I must be missing something—how can I do this? sources: http://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples