package com.mitel.bup.server;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.isomorphic.base.Init;

public class MimeTypeFilter implements Filter {

	private static final Logger logger = LoggerFactory.getLogger(MimeTypeFilter.class.getName());
	private FilterConfig filterConfig = null;
	@Override
	public void destroy() {
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
		
		System.out.println("Request Content Type - "+request.getContentType());
                response.setContentType("application/javascript");
                filterChain.doFilter(request, response);
		System.out.println("Response Content Type - "+response.getContentType());
	}

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		System.out.println("hi");
		this.filterConfig = filterConfig;
	}
}