http-headers

How can I get browser authentication popup?

↘锁芯ラ 提交于 2019-12-05 12:05:53
问题 Can anyone tell me, how can I get this browser authentication window ? 回答1: This popup is part of the HTTP-Authentication. In order to get it, you need to enable it in your web server. As Wikipedia puts it: When the server wants the user agent to authenticate itself towards the server, it can send a request for authentication. This request should be sent using the HTTP 401 Not Authorized response code containing a WWW-Authenticate HTTP header. The WWW-Authenticate header for basic

How can I tell when HTTP Headers have been sent in an ASP.NET application?

心不动则不痛 提交于 2019-12-05 11:41:21
问题 Long story short, I have an ASP.NET application I'm trying to debug and at some point, in very particular circumstances, the application will throw exceptions at a Response.Redirect() stating: "Cannot redirect after HTTP headers have been sent." Which I more or less get, except that I cannot figure out where the headers were sent. Is there something to look for in an ASP.NET application that will indicate that the HTTP headers have been sent? BONUS DIFFICULTY: The ASP.NET app is still in .NET

content-length header from php is overwritten !

感情迁移 提交于 2019-12-05 11:40:42
I'm trying to figure why the Content-Length header of php gets overwritten. This is demo.php <?php header("Content-Length: 21474836470");die; ?> a request to fetch the headers curl -I http://someserver.com/demo.php HTTP/1.1 200 OK Date: Tue, 19 Jul 2011 13:44:11 GMT Server: Apache/2.2.16 (Debian) X-Powered-By: PHP/5.3.3-7+squeeze3 Content-Length: 2147483647 Cache-Control: must-revalidate Content-Type: text/html; charset=UTF-8 See Content-Length ? It maxes out at 2147483647 bytes, that is 2GB. Now if modify demo.php like so <?php header("Dummy-header: 21474836470");die; ?> the header is not

How to set HttpHeader on individual request using HttpClient

时光总嘲笑我的痴心妄想 提交于 2019-12-05 11:31:23
I have an HttpClient that is shared across multiple threads: public static class Connection { public static HttpClient Client { get; } static Connection() { Client = new HttpClient { BaseAddress = new Uri(Config.APIUri) }; Client.DefaultRequestHeaders.Add("Connection", "Keep-Alive"); Client.DefaultRequestHeaders.Add("Keep-Alive", "timeout=600"); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } } It has some default headers I put onto each request. However, when I use it, I want to add on a header for just that request: var client = Connection

AWS Elastic Beanstalk: HTTP Header not appearing in Flask application

◇◆丶佛笑我妖孽 提交于 2019-12-05 11:26:37
I have a small Flask application that I want to run on AWS Elastic Beanstalk. The application deploys and runs fine but I've noticed that a custom HTTP Header (HTTP_CUSTOM_TOKEN) is not present in request.headers . I'm assuming I'm missing something from the Apache configuration but am not very familiar with that environment. What you need is something similar to what @Fartash suggested, just slightly different. Add .ebextensions/python.config : container_commands: 03wsgipass: command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf' as explained at Using the AWS Elastic Beanstalk Python

View and Set HTTP headers for Safari/Chrome

旧时模样 提交于 2019-12-05 11:09:59
问题 I'm testing an API and I would like to hit it with safari and see the raw json that's returned. The API requires a certain HTTP header be sent with every request. Is there a way in Safari or Chrome to set my http headers when visiting a URL? 回答1: There are a couple Google Chrome apps that do this. One is called Rest Console. I actually found an app called GraphicalHttpClient in the Mac AppStore that's a lot easier and more enjoyable to use. 回答2: Another popular chrome app for this is is

Which Java libraries do HTTP Accept Header Parsing? [closed]

微笑、不失礼 提交于 2019-12-05 10:52:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Which Java libraries parse HTTP Accept header? 回答1: Have a look at the HttpClient Util.parseHeader method. Edit: (trying to make this answer worth being accepted post-factum) The spring framework provides this functionality within its MediaType component. If you are already using Spring MVC you can simply

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

最后都变了- 提交于 2019-12-05 10:24:21
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 custom datetime header (which is in ticks instead of a string representation) makes the default one

Django and dynamically generated images

别等时光非礼了梦想. 提交于 2019-12-05 09:51:37
I have a view in my Django application that automatically creates an image using the PIL, stores it in the Nginx media server, and returns a html template with a img tag pointing to it's url. This works fine, but I notice an issue. For every 5 times I access this view, in 1 of them the image doesn't render. I did some investigation and I found something interesting, this is the HTTP response header when the image renders properly: Accept-Ranges:bytes Connection:keep-alive Content-Length:14966 Content-Type:image/jpeg Date:Wed, 18 Aug 2010 15:36:16 GMT Last-Modified:Wed, 18 Aug 2010 15:36:16 GMT

ColdFusion - how to set Content-Length header

落花浮王杯 提交于 2019-12-05 09:42:16
Has anyone successfully added a Content-Length header to regular ColdFusion (I'm using CF9) pages? I'm setting up a new server behind a Cisco load balancer with compression - the box refuses to compress anything without this header, but CF doesn't pass it by default. <cfheader name="Content-Length" value="something"> will set the header, but finding the right value is a problem. Any pointers would be much appreciated. Geoff I believe I've solved it: <cfheader name="Content-Length" value="#getPageContext().getCFOutput().getBuffer().size()#"> I stuck that in o nRequestEnd() and the Cisco box is