Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 853707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:48:18+00:00 2026-05-15T07:48:18+00:00

We have a site which is accessed entirely over HTTPS, but sometimes display external

  • 0

We have a site which is accessed entirely over HTTPS, but sometimes display external content which is HTTP (images from RSS feeds, mainly). The vast majority of our users are also stuck on IE6.

I would ideally like to do both of the following

  • Prevent the IE warning message about insecure content (so that I can show a less intrusive one, e.g. by replacing the images with a default icon as below)
  • Present something useful to users in place of the images that they can’t otherwise see; if there was some JS I could run to figure out which images haven’t been loaded and replace them with an image of ours instead that would be great.

I suspect that the first aim is simply not possible, but the second may be sufficient.

A worst case scenario is that I parse the RSS feeds when we import them, grab the images store them locally so that the users can access them that way, but it seems like a lot of pain for reasonably little gain.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:48:19+00:00Added an answer on May 15, 2026 at 7:48 am

    Your worst case scenario isn’t as bad as you think.

    You are already parsing the RSS feed, so you already have the image URLs. Say you have an image URL like http://otherdomain.example/someimage.jpg. You rewrite this URL as https://mydomain.example/imageserver?url=http://otherdomain.example/someimage.jpg&hash=abcdeafad. This way, the browser always makes request over HTTPS, so you get rid of the problems.

    The next part – create a proxy page or servlet that does the following –

    1. Read the URL parameter from the query string, and verify the hash
    2. Download the image from the server, and proxy it back to the browser
    3. Optionally, cache the image on disk

    This solution has some advantages. You don’t have to download the image at the time of creating the HTML. You don’t have to store the images locally. Also, you are stateless; the URL contains all the information necessary to serve the image.

    Finally, the hash parameter is for security; you only want your servlet to serve images for URLs you have constructed. So, when you create the URL, compute md5(image_url + secret_key) and append it as the hash parameter. Before you serve the request, recompute the hash and compare it to what was passed to you. Since the secret_key is only known to you, nobody else can construct valid URLs.

    If you are developing in Java, the Servlet is just a few lines of code. You should be able to port the code below on any other back-end technology.

    /*
    targetURL is the url you get from RSS feeds
    request and response are wrt to the browser
    Assumes you have commons-io in your classpath
    */
    
    protected void proxyResponse (String targetURL, HttpServletRequest request,
     HttpServletResponse response) throws IOException {
        GetMethod get = new GetMethod(targetURL);
        get.setFollowRedirects(true);
        /*
         * Proxy the request headers from the browser to the target server
         */
        Enumeration headers = request.getHeaderNames();
        while(headers!=null && headers.hasMoreElements())
        {
            String headerName = (String)headers.nextElement();
    
            String headerValue = request.getHeader(headerName);
    
            if(headerValue != null)
            {
                get.addRequestHeader(headerName, headerValue);
            }
        }
    
        /*Make a request to the target server*/
        m_httpClient.executeMethod(get);
        /*
         * Set the status code
         */
        response.setStatus(get.getStatusCode());
    
        /*
         * proxy the response headers to the browser
         */
        Header responseHeaders[] = get.getResponseHeaders();
        for(int i=0; i<responseHeaders.length; i++)
        {
            String headerName = responseHeaders[i].getName();
            String headerValue = responseHeaders[i].getValue();
    
            if(headerValue != null)
            {
                response.addHeader(headerName, headerValue);
            }
        }
    
        /*
         * Proxy the response body to the browser
         */
        InputStream in = get.getResponseBodyAsStream();
        OutputStream out = response.getOutputStream();
    
        /*
         * If the server sends a 204 not-modified response, the InputStream will be null.
         */
        if (in !=null) {
            IOUtils.copy(in, out);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site which allows my customers to setup content for their customers,
On my site, users have public profiles that can be accessed via http://mysite.com/vanity_url .
I have site which uses $(selector).load(path) function in more than 300 pages. Now my
I have a site which needs to be fully self-contained in the browser window,
I have a site which relies heavily on javaScript. I created a mirror site,
I have a site which I want to download using Unix wget . If
I have a site which has a lot of corners. I don't want to
I currently have a site which uses a MySQL 4.x schema, the site uses
Here's the setup. I have web site which is essentially a simple CMS. Here
I have built a site which requires user to login. Now I have decided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.