<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AppMetrics
{
	public static class WebUtil
	{
		public static void CheckIpAddress()
		{
			var request = HttpContext.Current.Request;
			var ip = request.UserHostAddress;
			if (ip != "127.0.0.1" && ip != "::1")
			{
				var response = HttpContext.Current.Response;
				response.Write("Access from this IP address is not allowed");
				response.Status = "401 Unauthorized";
				response.StatusCode = 401;
				response.End();
				throw new UnauthorizedAccessException();
			}
		}
	}
}<commit_msg>refactoring<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AppMetrics
{
	public static class WebUtil
	{
		public static void CheckIpAddress()
		{
			var request = HttpContext.Current.Request;
			if (!request.IsLocal)
			{
				var response = HttpContext.Current.Response;
				response.Write("Access from this IP address is not allowed");
				response.Status = "401 Unauthorized";
				response.StatusCode = 401;
				response.End();
				throw new UnauthorizedAccessException();
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.10890233362143474, 'fraction_numerical': 0.016421780466724288, 'mean_word_length': 3.765432098765432, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '4783701', 'n_tokens_mistral': 413, 'n_tokens_neox': 343, 'n_words': 92}