Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * BurpUtils.java
 *
 * Copyright (c) 2014 Luca Carettoni
 *
 * This file is part of Bradamsa, (B)urp Suite + (Radamsa)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version. This program is distributed in the
 * hope that it will be useful, but WITHOUT ANY WARRANTY.
 *
 */

public class Main {
    public static String getHost(byte[] request) {

        String requestStr = new String(request);
        String cookies = "";

        if (requestStr.contains("Host:")) {
            cookies = requestStr.substring(requestStr.indexOf("Host:"));
            cookies = cookies.substring(5, cookies.indexOf("\r\n")).trim();
        }
        return cookies;
    }
}