Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ide/static/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ class Content extends React.Component {

$.ajax({
url: 'layer_parameter/',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
async: false,
Expand Down Expand Up @@ -623,6 +627,10 @@ class Content extends React.Component {
const netData = JSON.parse(JSON.stringify(this.state.net));
$.ajax({
url: 'model_parameter/',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
data: {
Expand Down Expand Up @@ -738,6 +746,10 @@ class Content extends React.Component {
data['Bias']['params']['filler']['options'] = fillers;
$.ajax({
url: url[framework],
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
data: formData,
Expand Down Expand Up @@ -985,6 +997,10 @@ class Content extends React.Component {

$.ajax({
url: '/save',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
data: {
Expand Down Expand Up @@ -1061,6 +1077,10 @@ class Content extends React.Component {
this.dismissAllErrors();
$.ajax({
url: '/load',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
data: {
Expand Down Expand Up @@ -1189,6 +1209,10 @@ class Content extends React.Component {
updateHistoryModal() {
$.ajax({
url: '/model_history',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
dataType: 'json',
type: 'POST',
data: {
Expand Down
8 changes: 8 additions & 0 deletions ide/static/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Login extends React.Component {
logoutUser() {
$.ajax({
url: '/accounts/logout',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
type: 'GET',
processData: false, // tell jQuery not to process the data
contentType: false,
Expand Down Expand Up @@ -56,6 +60,10 @@ class Login extends React.Component {

$.ajax({
url: '/backendAPI/checkLogin',
headers: {
'X-Content-Type-Options' : 'nosniff',
'X-XSS-Protection' : '1; mode=block'
},
type: 'GET',
contentType: false,
data: {
Expand Down
5 changes: 4 additions & 1 deletion ide/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@


def index(request):
return render(request, 'index.html')
response = render(request, "index.html", {})
response['X-Content-Type-Options'] = 'nosniff'
response['X-XSS-Protection'] = '1'
return response


@csrf_exempt
Expand Down