<commit_before><?php namespace App\Http\Middleware;

use Closure;

class Secure
{

	/**
	 * Handle an incoming request.
	 *
	 * @param  \Illuminate\Http\Request $request
	 * @param  \Closure $next
	 * @return mixed
	 */
	public function handle($request, Closure $next)
	{
		// see http://stackoverflow.com/a/25095936
		if (($request->header('x-forwarded-proto') <> 'https'))
		{
			return redirect()->secure($request->getRequestUri());
		}

		return $next($request);
	}

}
<commit_msg>Re-process: #3: Use heroku variable for ssl instead of default Laravel's.<commit_after><?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\App;

class Secure
{

	/**
	 * Handle an incoming request.
	 *
	 * @param  \Illuminate\Http\Request $request
	 * @param  \Closure $next
	 * @return mixed
	 */
	public function handle($request, Closure $next)
	{
		if ((App::environment('production') && $request->header('x-forwarded-proto') <> 'https') || !$request->secure())
		{
			return redirect()->secure($request->getRequestUri());
		}

		return $next($request);
	}

}

{'fraction_non_alphanumeric': 0.16883116883116883, 'fraction_numerical': 0.008348794063079777, 'mean_word_length': 3.8823529411764706, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '1439345', 'n_tokens_mistral': 386, 'n_tokens_neox': 350, 'n_words': 78}