http-headers

How to send Cache-Control: no-cache in HTTP Response header?

落爺英雄遲暮 提交于 2019-12-23 09:29:25
问题 Net 4 and C#. I would need set send to Browser Cache-Control ( Cache-Control: no-cache ) in the HTTP Response header for a Web Form page. Any idea how to do it? Thanks for your time. 回答1: Try this: Response.AppendHeader("Cache-Control", "no-cache"); However, you should know that this header alone won't give you a reliable cross-browser way to prevent caching. See this answer for more accurate solution: Making sure a web page is not cached, across all browsers 回答2: In MVC you can set it in the

trouble changing request headers in Firefox with AngularJS

泄露秘密 提交于 2019-12-23 09:08:19
问题 My backend requires the 'Content-Type' request header to be exactly 'application/json'. This is a CORS request and everything works fine in Chrome. The exact header, from developer tools network tab source: Content-Type: application/json I set this in AngularJS with $http.default.headers.post and it works fine in Chrome. However it doesn't work in Firefox. Firefox sends this instead: Content-Type: application/json; charset=UTF-8 I tried to change headers by: settings $http.default.headers

Setting HTTP headers from a Firefox extension

僤鯓⒐⒋嵵緔 提交于 2019-12-23 08:54:01
问题 How can I set HTTP headers in my Firefox extension? I'll make it so these are only sent while hitting my site so I can detect if the plugin is installed or not and not promote the plugin if it is. 回答1: Here's the most compact way I found to make this work: Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService ).addObserver({ observe : function(subject, topic, data) { var channel = subject.QueryInterface( Components.interfaces.nsIHttpChannel

What is the exact response structure for HTTP status code 300 (Multiple Choices)?

 ̄綄美尐妖づ 提交于 2019-12-23 07:24:48
问题 When a user clicks a link to a drawing on my site http://mysite.com/some-drawing , I would like my server to respond with status code 300 and two resource locations: http://mysite.com/some-drawing.png and http://mysite.com/some-drawing.myapp , and have the client browser decide automatically which one to use, based on its capabilities: If MyApp is installed on the user's machine, then the browser should download the *.myapp version and use MyApp to display it. However, if MyApp is not

What is the exact response structure for HTTP status code 300 (Multiple Choices)?

♀尐吖头ヾ 提交于 2019-12-23 07:24:17
问题 When a user clicks a link to a drawing on my site http://mysite.com/some-drawing , I would like my server to respond with status code 300 and two resource locations: http://mysite.com/some-drawing.png and http://mysite.com/some-drawing.myapp , and have the client browser decide automatically which one to use, based on its capabilities: If MyApp is installed on the user's machine, then the browser should download the *.myapp version and use MyApp to display it. However, if MyApp is not

Which MIME type is correct for the .exe file?

微笑、不失礼 提交于 2019-12-23 06:48:06
问题 I try to find which MIME type corresponds to the each extension and I get ambigous results. According to webdesign.about.com the correct MIME for exe is: application/octet-stream According to freeformatter.com the correct MIME for exe is: application/x-msdownload and it says that application/octet-stream is MIME for bin extension. According to iana.org the correct MIME for exe (or sth called vnd.microsoft.portable-executable as I don't see exe there) is: application/vnd.microsoft.portable

How can I add “X-Content-Type-Options: nosniff” to all the response headers from my web server

浪子不回头ぞ 提交于 2019-12-23 04:52:23
问题 I am running an apache web server. I would like to add "X-Content-Type-Options: nosniff" to all the response headers going from my web server. How can I do that? Is it possible to make changes to apache config files to accomplish this? 回答1: Just append this to your webserver configuration, after making sure mod_headers is loaded: <Directory "your_web_server_documents_directory"> ....... Header always set X-Content-Type-Options nosniff ....... </Directory> 回答2: what i did is this. i place the

Can't set a header using Cors and Ajax

泪湿孤枕 提交于 2019-12-23 04:47:16
问题 Hello I am trying to do a http request with Basic Auth, but I can't set the header authorization and it is allowed in server. Ajax : $.ajax({ xhrFields: { withCredentials: true }, beforeSend: function(xhr){xhr.setRequestHeader('authorization', 'Basic cmFmmFuQHBoaWlubm92YXRpb25zLmNv=');}, url : 'http://www.vozi.dev.br/api/audio', type: 'POST', data: JSON.stringify(sender), dataType: 'json', contentType: 'application/json', success : function(data, textStatus, jqXHR) { //do something } }); Http

Was there ever a proposal to include the URL fragment into the HTTP request?

不羁岁月 提交于 2019-12-23 04:08:44
问题 In the current HTTP spec, the URL fragment (the part of the URL including and following the # ) is not sent to the server in any way. However with the increased spread of AJAX, which uses the fragment to maintain some form of state, there are a lot of situations where it would be useful for the server to have knowledge of the URL fragment at request time. For example, if you go to http://facebook.com, then click a user name in your stream, the URL will become http://faceboook.com/#!/username

Passing Custom Headers to Selenium from Capybara

三世轮回 提交于 2019-12-23 03:58:12
问题 We use custom headers to authenticate our web apps. An http proxy service intercepts requests, confirms the authenticity of the user and then injects custom headers into the request. In order to test the app, I need to write those headers into the request before it hits my ApplicationController methods. Right now, the current hack works for all my non-javascript tests: # in hooks.rb Before do require 'capybara/driver/rack_test_driver' module Capybara::Driver class Authentic < RackTest def env