<commit_before>window.addEventListener("load", () => {
  const SUPPORTED_TYPES = ["Files", "application/x-moz-file"];

  let body = document.getElementsByTagName("body")[0];

  body.addEventListener("dragover", (ev) => {
    if(SUPPORTED_TYPES.find(el => ev.dataTransfer.types.includes(el)))
      ev.preventDefault();
  });

  body.addEventListener("drop", (ev) => {
    if(SUPPORTED_TYPES.find(el => ev.dataTransfer.types.includes(el))) {
      ev.preventDefault();

      for(let i = ev.dataTransfer.files.length - 1; i >= 0; --i) {
        let file = ev.dataTransfer.files[i];
        let request = new XMLHttpRequest();
        request.open('PUT', document.URL + file.name);
        request.send(file);
      }
    }
  });
});<commit_msg>Fix Drag&Drop uploading w/o forward slash at end of URL<commit_after>window.addEventListener("load", () => {
  const SUPPORTED_TYPES = ["Files", "application/x-moz-file"];

  let body = document.getElementsByTagName("body")[0];

  body.addEventListener("dragover", (ev) => {
    if(SUPPORTED_TYPES.find(el => ev.dataTransfer.types.contains(el)))
      ev.preventDefault();
  });

  body.addEventListener("drop", (ev) => {
    if(SUPPORTED_TYPES.find(el => ev.dataTransfer.types.contains(el))) {
      ev.preventDefault();

      let url = document.URL;
      if(url[url.length - 1] != "/")
        url += "/";

      for(let i = ev.dataTransfer.files.length - 1; i >= 0; --i) {
        let file = ev.dataTransfer.files[i];
        let request = new XMLHttpRequest();
        request.open('PUT', url + file.name);
        request.send(file);
      }
    }
  });
});
{'fraction_non_alphanumeric': 0.1823273179838208, 'fraction_numerical': 0.0043559427504667085, 'mean_word_length': 3.1020408163265305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6230827', 'n_tokens_mistral': 530, 'n_tokens_neox': 521, 'n_words': 87}