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 8404529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:37:22+00:00 2026-06-09T22:37:22+00:00

I’m getting the error: XMLHttpRequest cannot load http://www.scirra.com/handlers/arcadeProcessScore.ashx. Origin http://static1.scirra.net is not allowed by

  • 0

I’m getting the error:

XMLHttpRequest cannot load http://www.scirra.com/handlers/arcadeProcessScore.ashx. Origin http://static1.scirra.net is not allowed by Access-Control-Allow-Origin.

On arcadeProcessScore.ashx I have the lines:

public void ProcessRequest (HttpContext context) {

    context.Response.AppendHeader("Access-Control-Allow-Origin", "http://static1.scirra.net");
    context.Response.AppendHeader("Access-Control-Allow-Origin", "https://static1.scirra.net");
    context.Response.ContentType = "text/plain";

Yet the error still persists.

I’ve also tried simply:

context.Response.AppendHeader("Access-Control-Allow-Origin", "*");

Which doesn’t work either.

If I add <add name="Access-Control-Allow-Origin" value="*"/> at the web.config level it works, but obviously isn’t the solution.

How can I let arcadeProcessScore.ashx accept requests from static1.scirra.net? Thanks for any help.

  • 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-06-09T22:37:23+00:00Added an answer on June 9, 2026 at 10:37 pm

    I did some testing of my own, directly using an XmlHttpRequest to access a handler in my project. The setup I used was to publish the application on my local IIS (which is version 6.1, so there might be differences in behaviour to 7.5) and to have the Default.aspx page call my handler running in the development server in Visual Studio. Like this:

    http://mymachine/WebTest/Default.aspx
    
    -> XmlHttpRequest get request to
    
    http://localhost:58025/WebTest/TestHandler.ashx
    

    Code in the handler:

    public void ProcessRequest (HttpContext context) {
        context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine");
        context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World " + DateTime.Now.ToString());
    }
    

    Using IE9, the behviour was the same regardless of whether or not I sent an Access-Control-Allow-Origin header back from the handler. IE9 gives warning, asking the user to confirm if the content should be loaded.

    Both Chrome (version 21.0.1180.79 m) and FF (version 14.0.1) actually generates requests to the handler and respects the header that the handler sends back.

    So this worked with Chrome and FF:

    context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine");
    

    So did this:

    context.Response.AppendHeader("Access-Control-Allow-Origin", "*");
    

    But I have not been able to get either of them to show the content if I try to add several different allowed origins in the same response. For me, none of these worked:

    1. Add several response headers

      context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine");
      context.Response.AppendHeader("Access-Control-Allow-Origin", "http://someothermachine");
      
    2. Add one header, two origins comma separated

      context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine, http://someothermachine");
      
    3. Add one header, two origins space separated

      context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine http://someothermachine");
      
    4. Add one header, two origins space separated

      context.Response.AppendHeader("Access-Control-Allow-Origin", "http://mymachine; http://someothermachine");
      

    To get it to work, what I did was to follow the advice given in this answer. My handler then looks like this:

    public void ProcessRequest(HttpContext context)
    {
        string[] allowedOrigins = new string[] { "http://mymachine", "http://someothermachine" };
        string origin = context.Request.Headers.Get("Origin");
        if (allowedOrigins.Contains(origin))
            context.Response.AppendHeader("Access-Control-Allow-Origin", origin);
        context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World " + DateTime.Now.ToString());
    }
    

    With this, both Chrome and FF accept the output from the handler from both origins.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.