javascript - Can xmlHttpRequest access the Authorization header in Firefox -
i may missing obvious... but
i trying enhance native subversion http access greasemonkey plugin. @ moment using cgi scripts run propfind etc. subverts security although work.
i have downloaded javascript dav client want http://debris.demon.nl/projects/davclient.js/. assuming can use user credentials supplied, should able extended subversion information using javascript correct security.
we run basic authentication on subversion server , not know how make xmlhttprequest in library inherit pre-existing browser authentication details. xmlhttprequest returns 401 although calling page authenticated , on same domain.
you can specify authorization
header manually using .setrequestheader(header, value)
.
according the spec:
if user agent supports http authentication ,
authorization
not in list of author request headers [setsetrequestheader
], should consider requests originatingxmlhttprequest
object part of protection space includes accessed uris , sendauthorization
headers , handle401 unauthorized
requests appropriately.
this seems mean if user has supplied authentication credentials resource, xhr automatically use them.
Comments
Post a Comment