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

  • Home
  • SEARCH
  • 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 3281590
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:49:56+00:00 2026-05-17T19:49:56+00:00

According to the Mozilla Developer Center HTTP access control article, cross-site POST requests can

  • 0

According to the Mozilla Developer Center HTTP access control article, cross-site POST requests can be “simple” — i.e. require no preflighting — if the request’s Content-Type is application/x-www-form-urlencoded.

I’m not getting this behavior in Firefox, and I’m not understanding at all why this is so. Here’s my setup code:

function makeXDomainRequest(url, method, data) {
    var req =
        typeof XDomainRequest !== "undefined" ?
        new XDomainRequest() : new XMLHttpRequest();

    req.open(method || "GET", url, true);

    if (typeof req.onload !== "undefined") {
        req.onload = onResponseLoad;
        req.onerror = onRequestError;
    } else {
        req.onreadystatechange = onRequestStateChange;
    }

    if (data && typeof req.setRequestHeader === "function") {
        req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    } else {
        // no way to set Content-Type req header in IE's XDomainRequest:
        // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
    }

    req.send(data || null);
}

function onResponseLoad() {
    alert("Response!\n" + this.responseText);
}

function onRequestError(args) {
    alert("Error!");
}

function onRequestStateChange() {
    if (this.readyState === 4) {
        if (this.status === 200) {
            onResponseLoad.apply(this);
        } else {
            onRequestError.apply(this);
        }
    }
}

And here’s the server I’m pinging:

// thanks to http://saltybeagle.com/cors/ for having this demo endpoint:
var URL = "http://ucommbieber.unl.edu/CORS/cors.php";

Now if I do a simple POST request — with data sent as application/x-www-form-urlencoded in the code above — the request is preflighted in Firefox with an OPTIONS request. It is not preflighted in Chrome. Open Fiddler before running this to see for yourself:

makeXDomainRequest(URL, "POST", "name=foobar");
// alerts "Response! Hello CORS [...] You sent a POST request. Your name is foobar"

Here is the preflight OPTIONS request in Fiddler (notice the Access-Control-Request-Method: POST header even though I specified a supposedly safe Content-Type and no custom headers):

OPTIONS http://ucommbieber.unl.edu/CORS/cors.php HTTP/1.1
Host: ucommbieber.unl.edu
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Origin: http://localhost
Access-Control-Request-Method: POST

What’s going on? Is this a bug in Firefox, or am I doing something wrong? Thanks!

  • 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-17T19:49:57+00:00Added an answer on May 17, 2026 at 7:49 pm

    It indeed turned out to be a Firefox bug. It ended up getting fixed for FF4b6: https://bugzilla.mozilla.org/show_bug.cgi?id=588920

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

Sidebar

Related Questions

The operator precedence table I can find is: https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence according to the table, both
I've been following the lessons about transparency and gradients on the Mozilla site: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Applying_styles_and_colors
According to this Mozilla article on Ogg media , media works more seamlessly in
According to a post at the very end of this thread you can replace
According to MDC https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp/exec the following code should log each of the global matches
According to this post a typical firefox user has 2-3 tabs open. How can
According to what I have found so far, I can use the following code:
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when
According to the feedparser documentation , I can turn an RSS feed into a
At the following URL: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsICacheVisitor is the following code chunk: boolean visitDevice(in string deviceID,

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.