kevinburke / doony

UI Improvements for Jenkins
http://doony.org
Other
970 stars 116 forks source link

fixing "build now" misbehaving #92

Open mvk opened 8 years ago

mvk commented 8 years ago

NOTE: this is 2nd of 2 issues causing these bugs #86 and #73

I have noticed the code is using the call to $.getJSON(), I looked at the request and the response resulting from the code, and compared it with the regular "build" button request and response. I'm attaching "sanitized" good and bad requests, Basically - good one had:

  1. the form data AND json urlencoded as form data
  2. header Upgrade-Insecure-Requests set to 1
  3. Accept is limited to a list of mime types
  4. Content-Type is set to application/x-www-form-urlencoded

good_req.txt

Bad req.:

  1. had no form data
  2. 0 content length
  3. weird header is set: X-Requested-With = XMLHttpRequest.

bad_req.txt

IF you guys wanna mess with it:

  1. do not ignore job page parameters forms, try using them, it is on /build page, form element's is parameters
  2. migrate from $.getJSON() back to "basics" of $.ajax() and set the missing headers on the way

But maybe you can just detect and ignore parametrized jobs :)