Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74100

[gitlab-logo] Extract inline script block and event handler in org/jenkinsci/plugins/gitlablogo/GitlabLogoProperty/global.jelly

XMLWordPrintable

    • 130.v9d2696eb_8dc6

      Problems

      == Inline Script Block
      Line: 25
      ----
      <script>
            var GitlabLogoProperty = {
              clearCache: function(){
                fetch("${rootURL}/descriptor/org.jenkinsci.plugins.gitlablogo.GitlabLogoProperty/clearCache", {
                  method: "post",
                  headers: crumb.wrap({}),
                }).then((rsp) => {
                  if (rsp.ok) {
                    alert("Clear cache done");
                  }
                });
              }
            };
          </script>
      ----
      
      == Inline Event Handler
      Line: 23
      ----
      <input type="button" value="clear" onclick="GitlabLogoProperty.clearCache();"/>
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            yafenkin Yaroslav Afenkin
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: