Don't send me your credentials when you POST errors thank you.

This commit is contained in:
Nicolas Stepien 2013-04-07 21:54:18 +02:00
parent a5c228fda8
commit 30c76eb81d
3 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ $.extend $,
fd.append key, val
fd
ajax: (url, callbacks, opts={}) ->
{type, headers, upCallbacks, form, sync} = opts
{type, cred, headers, upCallbacks, form, sync} = opts
r = new XMLHttpRequest()
type or= form and 'post' or 'get'
r.open type, url, !sync
@ -49,7 +49,7 @@ $.extend $,
r.setRequestHeader key, val
$.extend r, callbacks
$.extend r.upload, upCallbacks
r.withCredentials = type is 'post'
r.withCredentials = cred
r.send form
r
cache: do ->

View File

@ -1602,6 +1602,7 @@ DeleteLink =
onload: -> DeleteLink.load link, post, @response
onerror: -> DeleteLink.error link
}, {
cred: true
form: $.formData form
}
load: (link, post, html) ->

View File

@ -895,6 +895,7 @@ QR =
QR.error $.el 'span',
innerHTML: 'Connection error. You may have been <a href=//www.4chan.org/banned target=_blank>banned</a>.'
opts =
cred: true
form: $.formData postData
upCallbacks:
onload: ->