<commit_before>﻿using System;
using System.Net.Http;
using System.Web.Http;

namespace mongo_todo
{
	public static class ApiControllerExtension
	{
		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string id, string relativeLocation)
		{
			return GetLinkHeader<T>(controller, request, response, id, relativeLocation, string.Empty);
		}

		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string relativeLocation)
		{
			return GetLinkHeader<T>(controller, request, response, string.Empty, relativeLocation, string.Empty);
		}

		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string id, string relativeLocation, string description)
		{
			string currentUri = controller.Request.RequestUri.AbsoluteUri;
			if (!string.IsNullOrEmpty(id)) currentUri = string.Concat(currentUri, "/", id);

			var uri = new Uri(string.Concat(currentUri, relativeLocation));
			string rel = typeof(T).Name;

			string type = string.Empty;
			if (response != null
				&& response.Content != null
				&& response.Content.Headers != null
				&& response.Content.Headers.ContentType != null
			)
				type = response.Content.Headers.ContentType.MediaType;

			string location = string.Format("<{0}>", uri);
			if (!string.IsNullOrWhiteSpace(rel)) string.Concat(location, "; rel=", rel);
			if (!string.IsNullOrWhiteSpace(type)) string.Concat(location, "; type=\"", type, "\"");
			if (!string.IsNullOrWhiteSpace(description)) string.Concat(location, "; title=\"", description, "\"");

			return location;
		}
	}
}<commit_msg>Assigned the value of the link string since strings are immutable, doh<commit_after>﻿using System;
using System.Net.Http;
using System.Web.Http;

namespace mongo_todo
{
	public static class ApiControllerExtension
	{
		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string id, string relativeLocation)
		{
			return GetLinkHeader<T>(controller, request, response, id, relativeLocation, string.Empty);
		}

		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string relativeLocation)
		{
			return GetLinkHeader<T>(controller, request, response, string.Empty, relativeLocation, string.Empty);
		}

		public static string GetLinkHeader<T>(this ApiController controller, HttpRequestMessage request, HttpResponseMessage response, string id, string relativeLocation, string description)
		{
			string currentUri = controller.Request.RequestUri.AbsoluteUri;
			if (!string.IsNullOrEmpty(id)) currentUri = string.Concat(currentUri, "/", id);

			var uri = new Uri(string.Concat(currentUri, relativeLocation));
			string rel = typeof(T).Name;

			string type = string.Empty;
			if (response != null
				&& response.Content != null
				&& response.Content.Headers != null
				&& response.Content.Headers.ContentType != null
			)
				type = response.Content.Headers.ContentType.MediaType;

			string location = string.Format("<{0}>", uri);
			if (!string.IsNullOrWhiteSpace(rel)) location = string.Concat(location, "; rel=", rel);
			if (!string.IsNullOrWhiteSpace(type)) location = string.Concat(location, "; type=\"", type, "\"");
			if (!string.IsNullOrWhiteSpace(description)) location = string.Concat(location, "; title=\"", description, "\"");

			return location;
		}
	}
}
{'fraction_non_alphanumeric': 0.11797752808988764, 'fraction_numerical': 0.0005617977528089888, 'mean_word_length': 5.3362989323843415, 'pattern_counts': {'":': 0, '<': 15, '<?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': '6596125', 'n_tokens_mistral': 1062, 'n_tokens_neox': 964, 'n_words': 252}