Skip to content

Commit a395c5b

Browse files
alvinthenflovilmart
authored andcommitted
Make javascript key optional (#570)
Close #569
1 parent d91dc6d commit a395c5b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ParseFile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,12 @@ var DefaultController = {
243243
// To directly upload a File, we use a REST-style AJAX request
244244
var headers = {
245245
'X-Parse-Application-ID': CoreManager.get('APPLICATION_ID'),
246-
'X-Parse-JavaScript-Key': CoreManager.get('JAVASCRIPT_KEY'),
247246
'Content-Type': source.type || (source.file? source.file.type : null)
248247
};
248+
var jsKey = CoreManager.get('JAVASCRIPT_KEY');
249+
if (jsKey) {
250+
headers['X-Parse-JavaScript-Key'] = jsKey;
251+
}
249252
var url = CoreManager.get('SERVER_URL');
250253
if (url[url.length - 1] !== '/') {
251254
url += '/';

0 commit comments

Comments
 (0)