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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:28:43+00:00 2026-05-13T15:28:43+00:00

I’m trying to make a request using dojo.xhrGet to grab some XML data from

  • 0

I’m trying to make a request using dojo.xhrGet to grab some XML data from a server. I’m using dojo 1.4.0.

The server requires that I pass credentials through a custom HTTP header called Myauthtoken.

Everything works fine in Safari. The code pops up a dialog showing [object Document]. But in Firefox, the dialog shows null. Somewhere along the process, the custom header is being dropped or corrupted, and the server doesn’t accept it.

The relevant code looks something like this:

dojo.xhrGet({
  url: 'https://host.com/path/to/thing?param1=one&param2=two',
  headers: {
    'Myauthtoken': 'username:password'
  },
  handleAs: 'xml',
  load: function(response) {
    alert(response);
  },
  error: function(e) {
    alert("error: " + e);
  }
});

In Firefox, Firebug displays the following Request Headers:

Host: host.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
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: 300
Connection: keep-alive
Origin: null
Access-Control-Request-Method: GET
Access-Control-Request-Headers: myauthtoken,x-requested-with

The server responds with a 403 (Forbidden) and these Response Headers:

Date: Thu, 28 Jan 2010 20:02:47 GMT
Server: Noelios-Restlet-Engine/1.0.6
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 337
Connection: close


Update!
I’ve been researching, and it looks like the problem is that Firefox is attempting to preflight the request because of the custom headers, while Safari isn’t, and is instead just sending the custom headers without first checking if they’re valid.

I also figured out how to look at the Request in Safari:

Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Myauthtoken: username:password
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10

And the Response Headers:

Cache-Control: no-store
Connection: close
Content-Length: 236391
Content-Type: application/xml; charset=ISO-8859-1
Date: Fri, 29 Jan 2010 23:02:22 GMT
Server: Noelios-Restlet-Engine/1.0.6

The main difference being the Content-Length: 235391

Unfortunately, I’m still not much closer to actually finding a solution- still looking for some good ideas, or really any ideas at all.

Any thoughts on what’s going on and how I can get around this?

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-13T15:28:43+00:00Added an answer on May 13, 2026 at 3:28 pm

    After a bit more research, it looks like the problem is that the server is expecting the headers to be case-sensitive, while Firefox is converting the headers to lowercase.

    Firefox is sending myauthtoken, while the server is expecting Myauthtoken.

    In the end, it all came down to a bit of code where we were using getFirstValue(String name), which defaults to case-sensitive, instead of getFirstValue(String name, boolean ignoreCase).

    Watch out for case-sensitive headers!

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

Sidebar

Ask A Question

Stats

  • Questions 289k
  • Answers 289k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The conversion to single isn't adding extra precision. 10219150 is… May 13, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer Like the error says, does your table have an identity… May 13, 2026 at 5:36 pm
  • Editorial Team
    Editorial Team added an answer A library will consist of common functions or classes that… May 13, 2026 at 5:36 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.