<commit_before>import * as superagent from "superagent";
import { JWT } from "../types";

export function doGet(url, jwt = "") {
  const headers = {
    Accept: "application/json",
    "Content-Type": "application/json",
  };

  if (jwt) headers["X-SaaSquatch-User-Token"] = jwt;

  const request = superagent.get(url).withCredentials().set(headers);

  return thenableSuperagent(request).then(
    (response) => {
      if (
        //@ts-ignore -- superagent types might just be outdated?
        response.headers["content-type"] &&
        //@ts-ignore -- superagent types might just be outdated?
        includes(
          response.headers["content-type"].toLowerCase(),
          "application/json"
        )
      ) {
        return JSON.parse(response.text);<commit_msg>CH: Merging in multi-threaded server creation<commit_after>import * as superagent from "superagent";
import { JWT } from "../types";
import Cookies from "js-cookie";

export function doGet(url, jwt = "") {
  const headers = {
    Accept: "application/json",
    "Content-Type": "application/json",
    "Cookie": "_saasquatch=" + Cookies.get('_saasquatch')
  };

  if (jwt) headers["X-SaaSquatch-User-Token"] = jwt;

  const request = superagent.get(url).withCredentials().set(headers);

  return thenableSuperagent(request).then(
    (response) => {
      if (
        //@ts-ignore -- superagent types might just be outdated?
        response.headers["content-type"] &&
        //@ts-ignore -- superagent types might just be outdated?
        includes(
          response.headers["content-type"].toLowerCase(),
          "application/json"
        )
      ) {
        return JSON.parse(response.text);
{'fraction_non_alphanumeric': 0.14770696843359143, 'fraction_numerical': 0.0, 'mean_word_length': 2.879907621247113, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 5, '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': '1252380', 'n_tokens_mistral': 500, 'n_tokens_neox': 492, 'n_words': 111}