<commit_before>package com.atlassian.plugin.servlet;

import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.elements.ResourceLocation;

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

public class DownloadableWebResource extends AbstractDownloadableResource
{
    public DownloadableWebResource(BaseFileServerServlet servlet, Plugin plugin, ResourceLocation resourceDescriptor, String extraPath)
    {
        super(servlet, plugin, resourceDescriptor, extraPath);
    }

    public void serveResource(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException
    {
        try
        {
            httpServletRequest.getRequestDispatcher(getLocation()).forward(httpServletRequest, httpServletResponse);
        }
        catch (ServletException e)
        {
            e.printStackTrace();
            throw new IOException(e.getMessage());
        }<commit_msg>PLUG-38: set content-type header correctly for DownloadableWebResource responses<commit_after>package com.atlassian.plugin.servlet;

import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.elements.ResourceLocation;

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

public class DownloadableWebResource extends AbstractDownloadableResource
{
    public DownloadableWebResource(BaseFileServerServlet servlet, Plugin plugin, ResourceLocation resourceDescriptor, String extraPath)
    {
        super(servlet, plugin, resourceDescriptor, extraPath);
    }

    public void serveResource(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException
    {
        try
        {
            httpServletResponse.setContentType(getContentType()); // this will be used if content-type is not set by the forward handler, e.g. for webapp content in Tomcat
            httpServletRequest.getRequestDispatcher(getLocation()).forward(httpServletRequest, httpServletResponse);
        }
        catch (ServletException e)
        {
            e.printStackTrace();
            throw new IOException(e.getMessage());
        }
{'fraction_non_alphanumeric': 0.07096212451023073, 'fraction_numerical': 0.0008707009142359599, 'mean_word_length': 4.187358916478555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6080245', 'n_tokens_mistral': 538, 'n_tokens_neox': 537, 'n_words': 127}