bug fix: headers do not allow underscore

master
Gogs 4 years ago
parent 864dfaf5c6
commit 5412c56620

@ -84,16 +84,17 @@ jx.cloudview.oauth.listen = function (key,callback,err) {
http.setHeader('code', encodeURIComponent(p.code)) http.setHeader('code', encodeURIComponent(p.code))
http.setHeader('pid', 'authentication') http.setHeader('pid', 'authentication')
http.setHeader('platform', navigator.appName) http.setHeader('platform', navigator.appName)
http.setHeader('redirect_uri', key) http.setHeader('redirect-uri', key)
http.post(url, function (x) { http.post(url, function (x) {
try{ try{
var info = JSON.parse(x.responseText) var info = JSON.parse(x.responseText)
callback(info) callback(info)
}catch(e){ }catch(e){
if (err != null){ if (err != null){
err(e) err(e)
} }else {console.log(e)}
} }

Loading…
Cancel
Save