package com.agilex.vamf.web;

import com.agilex.vamf.utils.URLUtility;
import com.sun.jersey.spi.spring.container.servlet.SpringServlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URI;

/**
 * Created by guthriev on 4/15/14.
 */
public class MissionHealthSpringServlet extends SpringServlet {

    @Override
    public int service(URI baseUri, URI requestUri, HttpServletRequest request,
                       HttpServletResponse response) throws ServletException, IOException {

        URI baseUriWithOutStandardPort = URLUtility.removeStandardPortsFromUri(baseUri);
        URI requestUriWithOutStandardPort = URLUtility.removeStandardPortsFromUri(requestUri);

        return super.service(baseUriWithOutStandardPort, requestUriWithOutStandardPort, request, response);
    }
}
