简体   繁体   中英

CORS Support in Asterisk PBX Web Server

Aterisk PBX has a built-in web server, I am trying to login to My Asterisk PBX through AMI over HTTP from my Local Computer. My problem is that when I call the Login Action over HTTP the Manager is connected but response's MIME type is "text/plain", but I need the MIME type to be "text/javascript". The Error below is raised in Chrome Developer tool:

Resource interpreted as Script but transferred with MIME type text/plain: http://172.16.100.100:8088/asterisk/rawman?action=Login&username=username&secret=pass&_=1394447007551". HYPERLINK "http://localhost:16328/Scripts/jquery-1.10.2.js"jquery-1.10.2.js:8516

It is very simple server, it not designed to give you correct mime-type.

You have 3 options

1) load jquery from google CDN

2) Put javascript inside html page.

3) Extend server(it is opensource, your remember?) for your need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM