← Back to team overview

openstack team mailing list archive

Keystone API

 

Hi,

I'am working on enhancing keystone PublicAPI to support CORS.
Everything seem to work well except that Keystone is formatting
responses with Transfer-Encoding: chunked which isn't accepted for
OPTIONS query by browsers (chrome, firefox). Does anyone knows how to
force keystone API to use plain format ? My CorsController is as
follows:


class CorsController(wsgi.Application):
    def __init__(self):
        super(CorsController, self).__init__()
    def get_options(self, context):
        headers = [('Access-Control-Allow-Headers',
'origin,content-type,accept,x-auth-token')]
        headers.append(('Access-Control-Allow-Methods', 'POST'))
        headers.append(('Access-Control-Allow-Origin',
'https://178.239.138.10:8433'))
        headers.append(('Access-Control-Max-Age', '60'))
        headers.append(('Content-Length', '0'))
        return wsgi.render_response(status=(200, 'OK'),
                                    headers=headers)


Sample request:

 echo -e 'OPTIONS /v2.0/tokens HTTP/1.1\r\n' | nc 10.76.0.119 5000
HTTP/1.1 200 OK
Access-Control-Allow-Headers: origin,content-type,accept,x-auth-token
Access-Control-Allow-Methods: POST
Access-Control-Allow-Origin: https://10.76.0.119:8433
Access-Control-Max-Age: 60
Date: Thu, 21 Jun 2012 16:52:33 GMT
Transfer-Encoding: chunked




-- 
Tomasz Paszkowski
SS7, Asterisk, SAN, Datacenter, Cloud Computing
+48500166299


Follow ups