http-headers

HTTP_X_REQUESTED_WITH not set in ajax call with jquery

人走茶凉 提交于 2019-12-05 14:59:52
I am using Django to develop a new website and I am facing a problem with an ajax request. I have been googling a lot and read a lot of posts and articles (most of them explain the same). The issue: The ajax call is executed and I received the request in the view, but the request.is_ajax() returns false. For what I know the request.is_ajax() checks the value of the HTTP_X_REQUESTED_WITH header, but I can't see it in the request headers, thus I cannot check the is_ajax() in my view. HTML form: <form id="search-form" method="get" action="/search/"> <input type="text" id="search" name="search"

preemptive authentication why

只谈情不闲聊 提交于 2019-12-05 14:46:59
Why preemptive authentication required ? System.setProperty("httpclient.authentication.preemptive", "true"); I had written web services access client program in java. Where we were setting username and password in call object and that was working perfectly. Recently, our service provider made some changes at their side and after that they were not receiving username & password in web service call and as they were not receiving username & passwod so we were not able to connect to their (provider) service. Then i did googling and found about preemptive authentication. While calling web services

What is the difference between “always” and “onsuccess” in Apache's Header config?

不羁岁月 提交于 2019-12-05 13:52:57
I have a website where virtual hosts are defined in /etc/apache2/sites-enabled/ with a header being set with the always option like this: Header always set X-Frame-Options DENY If I now set the same header using .htaccess in the web site's root folder, but without always then the header is returned twice in the server's response. The setting in .htaccess (amongst others): Header set X-Frame-Options DENY The server's response: HTTP/1.1 200 OK Date: Mon, 02 May 2016 16:02:29 GMT Server: Apache/2.4.10 (Debian) X-Frame-Options: DENY Cache-Control: no-cache, no-store, must-revalidate, private

How to remove (duplicate) X-Powered-By: JSF/2.0

有些话、适合烂在心里 提交于 2019-12-05 13:48:05
In my instance, I have Glassfish 3.1.1 / Mojarra 2.1.3 I could remove the X-Powered-By in Glassfish Admin Console in the Network listener (so it doesn't show the long text: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.1 Java/Sun Microsystems Inc./1.6) but it still shows (yes, twice): X-Powered-By: JSF/2.0 X-Powered-By: JSF/2.0 I am using Jersey and JAXB to expose some web-services and have some servlets deployed using the @WebServlet Annotation but I don't think they add anything. It is not generated by mod_jk or Apache because I get those headers even when connecting to the

Google Calendar API - can only update event once

陌路散爱 提交于 2019-12-05 13:15:35
I've encountered the same problem as described in this post: Google Calendar api v3 re-update issue Namely, once I create an event and update it once using the Google Calendar API (v3), I am no longer able to update the event. When I attempt to, I get a 400 - Invalid value response. (FWIW I'm working in PHP). Following a lead offered in the post I referenced above, I attempted to solve the issue using etags (though admittedly my grasp of how they work is limited). Basically, on event update, the API returns an etag in its response, which I now save in my database. Then for subsequent (n > 1)

Android WebView Post Request with Custom Headers

坚强是说给别人听的谎言 提交于 2019-12-05 12:41:11
问题 I could see there are two separate methods in Android docs to post the data and add the headers. For setting Headers public void loadUrl (String url, Map<String, String> additionalHttpHeaders) For setting Post Data public void postUrl (String url, byte[] postData) But what I really required is to post the data along with headers. ( Means I want a single method which does both the task ? ) Can somebody please help me out with that. Thanks :) 回答1: I've bumped on same problem recently and after

Why Does FireFox Not Include the .xml Extension when Downloading a File?

不打扰是莪最后的温柔 提交于 2019-12-05 12:17:17
OK. I'm sure it does download XML files with the .xml extension, but I'm wondering what is missing in the code here to cause the .xml extenstion to be missing from the downloaded file. Note: This works in IE 6+ (didn't try WebKit based browsers or Opera) private void GenerateXmlAttachment(string xmlInStringFormat, string fileName) { // Where fileName = "someFile.xml" HttpResponse response = HttpContext.Current.Response; response.Clear(); response.Charset = string.Empty; response.ContentEncoding = Encoding.Default; response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);

Result from $_SERVER['HTTP_REFERER'], when referer header is not sent to server

落爺英雄遲暮 提交于 2019-12-05 12:16:39
问题 When the browser sends header info to the server, $_SERVER['HTTP_REFERER'] should give us the previous page URL right? What returns from $_SERVER['HTTP_REFERER'] , when header info is not sent to server? empty string? false? null? or... ? 回答1: If the HTTP referer request header is not sent then the $_SERVER['HTTP_REFERER'] is probably not set, although it could be an empty string. Whether it is set or not in this case could depend on the server. As with all HTTP request headers, check for its

What should the Content-Type be for a 4xx error without a body?

二次信任 提交于 2019-12-05 12:15:35
问题 Consider an HTTP request that gets the following response: 405 Method Not Allowed Content-Length: 0 What should the content-type of something like this be? Set to nothing? Not set? Set to text/plain or text/html 回答1: You haven't got any content, therefore I wouldn't set a Content-Type at all. If you find that causes problems to clients (which seems unlikely, to be honest), I'd probably go with text/plain - definitely not text/html , as your "empty content" is not an HTML document. 来源: https:/

Browser audio-playback fails when Accept-Ranges not set in http headers; WHY?

拥有回忆 提交于 2019-12-05 12:13:06
I recently discovered something (that surprises me) when opening an audio file in firefox or chrome. If I don't specify the HTTP response header "Accept-Ranges: bytes", firefox won't be able to determine the length of the ogg file (in seconds) before reaching the end in playback. Chrome will discover the length of the ogg file (in seconds), but the audio player appears to crash when it reaches the end, and refuses to re-play the file after the crash. Other browsers were not tested. Working Http response headers: HTTP/1.1 200 OK Accept-Ranges: bytes Content-Type: application/ogg Content-Length: