http-headers

How to download a file with its original filename from GAE's blobstore?

狂风中的少年 提交于 2019-12-10 16:24:21
问题 Once you upload a file to the blobstore, it renames it something like "s9QmBqJPuiVzWbySYvHVRg==". If you navigate to its "/serve" URL to download the file, the downloaded file is named this jumble of letters. Is there a way to have the downloaded file retain its original filename when uploaded? 回答1: When the file is uploaded using the BlobUploadHandler the original filename is stored as name property in the newly created BlobInfo entity. In the blob serve handler, you can specify that the

PHP Redirect with Custom Headers

偶尔善良 提交于 2019-12-10 16:23:59
问题 I am writing a basic authorization system and I am struggling with it a bit. There are two files involved - index.php and login.php . The login form is pretty simple (it's inside index.php ): <fieldset class="right"> <label for="email">Email <input id="email" name="email" type="text" value=""/> </label> <label for="password">Password <input id="password" name="password" type="password" /> <a href="#" onclick="$('#password-box').toggle();" >Forgot your password?<span></span></a> </label> <div

Don't save URL in history, any header or meta-tag?

你说的曾经没有我的故事 提交于 2019-12-10 15:57:53
问题 Is there any HTTP-headers or meta-tags one can use to avoid getting a URL into the browser history? For example, I don't want http://domain.td/show/super-secret-unique-token-that-is-private to show up in the browser URL bar, when I start typing "domain.t". Currently I have a (POST) search form on the website to load the tokens, and they don't come up. But later I want to load the tokens via links, from let's say an album. 回答1: I don't think you can. You can save the token as a cookie, or use

how to get around “Content-encoding gzip deflate” header sent by Chrome?

♀尐吖头ヾ 提交于 2019-12-10 15:29:37
问题 We have a simple HTML login form on our embedded device's web server. The web server is custom coded because of severe memory limitations. Regardless of these limitations, we like Chrome and would like to support it. All browsers post an HTTP Request to our login form containing the expected "username=myname&password=mypass" string, but not Chrome. Instead we receive from Chrome a "Content-encoding gzip deflate" request. BTW, by "all browsers", I mean this was tested to work fine on Internet

Specifying locale for http request/response

牧云@^-^@ 提交于 2019-12-10 15:29:10
问题 I have a ReSTful web service which needs to parse locale-sensitive data from the request. This data could either be in an XML body or part of the query string. Is there any acepted way of determining which locale the data is being sent in (and by extension the locale in which the response should be sent)? One option is simply to specify to the clients the locale in which all requests should be sent. A friendlier option seems to be to allow the client to specify the locale. I've considered: a)

Django Rest Framework: redirect to Amazon S3 fails when using Token Authentication

我的未来我决定 提交于 2019-12-10 14:59:57
问题 I'm using token authentication in DRF and for a certain API call, want to redirect to S3 (using a URL like https://my_bucket.s3.amazonaws.com/my/file/path/my_file.jpg?Signature=MY_AWS_SIGNATURE&AWSAccessKeyId=MY_AWS_ACCESS_KEY_ID ). However, I get the following error from AWS: <Error> <Code>InvalidArgument</Code> <Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>

Failed to load PDF document in Chrome

梦想的初衷 提交于 2019-12-10 14:53:45
问题 I have a PDF file stored on my server. I am unable to access the file using Google Chrome (or Ubuntu Chromium) via URL "sitename/pdfName.pdf" ; while I am able to access the same PDF in Internet Explorer or FireFox without a problem. Chrome is giving this error: "Failed to load PDF document" Find attaching the error in this link Error Image. 回答1: We had object:none in our security policy inside web.config, that was causing chrome to refuse to open it, and pressing f12 in chrome and then click

are multiple linear white space allowed in http header

爱⌒轻易说出口 提交于 2019-12-10 14:36:10
问题 I'm trying to understand http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 HTTP/1.1 header field values can be folded onto multiple lines if the continuation line begins with a space or horizontal tab. All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream. LWS = [CRLF] 1*( SP | HT ) Can i put any number of <CR><LF><SP> , without

No browser is sending Authorization info in header

孤人 提交于 2019-12-10 14:35:29
问题 I'm looking at this and this and it would appear 'easy' to send the credentials in the URL. For example: http://gooduser:secretpassword@www.example.com/webcallback?foo=bar This is all well and good but it doesnt work . I've turned fiddler on and for Chrome the Authorization header isnt sent. It appears to exhibit the same behaviour for other browsers (i've got a breakpoint on the server and no Authorize header turns up for Firefox,Safari or IE either) How to make it better? 回答1: Stumbled

HTTP error handling

无人久伴 提交于 2019-12-10 13:47:49
问题 This is my first post here, so I hope that I am posting this question the right place. Otherwise, please let me know so that I know for next time I post here :) I am working on a RoR website and would like to handle server errors (400, 404, 500, etc.) individually. Also, since the website is dynamic I would like to handle the errors within the rails environment rather than at the server level. An example of what I would like to do could be to present the user with optional material or a