Skip to content

Commit

Permalink
Remove legacy Prototype.js code (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Oct 2, 2024
1 parent 7664ee3 commit 36263ff
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions core/src/main/resources/org/kohsuke/stapler/bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ function makeStaplerProxy(url,staplerCrumb,methods) {
if (url.substring(url.length - 1) !== '/') url+='/';
var proxy = {};

var stringify;
if (Object.toJSON) // needs to use Prototype.js if it's present. See commit comment for discussion
stringify = Object.toJSON; // from prototype
else if (typeof(JSON)=="object" && JSON.stringify)
stringify = JSON.stringify; // standard

var genMethod = function(methodName) {
proxy[methodName] = function() {
var args = arguments;
Expand Down Expand Up @@ -38,7 +32,7 @@ function makeStaplerProxy(url,staplerCrumb,methods) {
fetch(url + methodName, {
method: 'POST',
headers: headers,
body: stringify(a),
body: JSON.stringify(a),
})
.then(function(response) {
if (response.ok) {
Expand Down

0 comments on commit 36263ff

Please sign in to comment.