librelist archives

« back to archive

HTTP authentication at OPTIONS method

HTTP authentication at OPTIONS method

From:
Christoph Heer
Date:
2011-02-20 @ 21:35
Hi,

I am writing at the moment an API for a project in flask. I call some
functions over $.ajax from jQuery with the username and the password
setting. The first thing what jQuery do is making a request with the
options method if in this response no WWW-Authenticate Header than
jQuery make the "real" request without the username and password. Now
is my question how I can modify the header of the options response?

Best regards
Christophe

Re: [flask] HTTP authentication at OPTIONS method

From:
Adam Oakman
Date:
2011-02-20 @ 23:57
Hi Christophe,
     I would think you can access the properties of the response  
object before returning it to jquery. 
http://flask.pocoo.org/docs/api/?highlight=response#flask.Response

A

On Feb 20, 2011, at 3:35 PM, Christoph Heer wrote:

> Hi,
>
> I am writing at the moment an API for a project in flask. I call some
> functions over $.ajax from jQuery with the username and the password
> setting. The first thing what jQuery do is making a request with the
> options method if in this response no WWW-Authenticate Header than
> jQuery make the "real" request without the username and password. Now
> is my question how I can modify the header of the options response?
>
> Best regards
> Christophe