⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msslredirector.java

📁 httptunnel.jar httptunnel java 源码
💻 JAVA
字号:
package net.jumperz.app.MGuardian.plugin;

import net.jumperz.net.*;
import net.jumperz.util.*;
import java.net.*;
import java.util.*;
import java.io.*;

public class MSslRedirector
extends MGuardianPlugin
{
//--------------------------------------------------------------------------------
public Map execute( Map sessionInfo )
throws IOException
{
MHttpResponse response = ( MHttpResponse )sessionInfo.get( "response" );
if( response == null )
	{
	return null;
	}
String protocol = ( String )sessionInfo.get( "protocol" );
if( !protocol.equals( "HTTPS" ) )
	{
	return null;
	}
int statusCode = response.getStatusCode();
if( statusCode < 300 || 400 <= statusCode )
	{
	return null;
	}

if( !response.headerExists( "Location" ) )
	{
	return null;
	}

String location = response.getHeaderValue( "Location" );
if( location.indexOf( "http://" ) == 0 )
	{
	location = location.replaceFirst( "^http", "https" );
	response.setHeaderValue( "Location", location );
	}

return null;
}
//--------------------------------------------------------------------------------
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -