Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #10690 > unrolled thread

HTTPS Relative XMLHttpRequest

Started byMC <news@aisus.com>
First post2012-01-28 15:37 -0600
Last post2012-01-31 04:03 -0800
Articles 11 — 5 participants

Back to article view | Back to comp.lang.javascript


Contents

  HTTPS Relative XMLHttpRequest MC <news@aisus.com> - 2012-01-28 15:37 -0600
    Re: HTTPS Relative XMLHttpRequest Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-29 00:32 +0100
      Re: HTTPS Relative XMLHttpRequest Stefan Weiss <krewecherl@gmail.com> - 2012-01-29 07:31 +0100
        Re: HTTPS Relative XMLHttpRequest Tim Streater <timstreater@greenbee.net> - 2012-01-29 10:58 +0000
          Re: HTTPS Relative XMLHttpRequest MC <news@aisus.com> - 2012-01-29 21:02 -0600
        Re: HTTPS Relative XMLHttpRequest Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-29 14:57 +0100
        Re: HTTPS Relative XMLHttpRequest MC <news@aisus.com> - 2012-01-29 21:00 -0600
          Re: HTTPS Relative XMLHttpRequest Stefan Weiss <krewecherl@gmail.com> - 2012-02-01 13:34 +0100
            Re: HTTPS Relative XMLHttpRequest MC <news@aisus.com> - 2012-02-02 08:55 -0600
      Re: HTTPS Relative XMLHttpRequest MC <news@aisus.com> - 2012-01-30 08:01 -0600
        Re: HTTPS Relative XMLHttpRequest Scott Sauyet <scott.sauyet@gmail.com> - 2012-01-31 04:03 -0800

#10690 — HTTPS Relative XMLHttpRequest

FromMC <news@aisus.com>
Date2012-01-28 15:37 -0600
SubjectHTTPS Relative XMLHttpRequest
Message-ID<87d20$4f246a58$cf9b4ad3$21106@ALLTEL.NET>
Dear Group,

I have searched and found references by pointy-ears and Cornfed that it 
is possible to do a relative addressed secure XMLHttpRequest but nowhere 
can I find a sample of how to do it, nor can I figure it out. Can 
someone please present an example or link to such?

Thanks!

[toc] | [next] | [standalone]


#10692

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-01-29 00:32 +0100
Message-ID<1364299.WGnKmheAe9@PointedEars.de>
In reply to#10690
MC wrote:

> I have searched and found references by pointy-ears and Cornfed […]

Please do not feed the troll (adjust your score-/killfile instead).


F'up2 where it belongs

PointedEars
-- 
Sometimes, what you learn is wrong. If those wrong ideas are close to the 
root of the knowledge tree you build on a particular subject, pruning the 
bad branches can sometimes cause the whole tree to collapse.
  -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>

[toc] | [prev] | [next] | [standalone]


#10697

FromStefan Weiss <krewecherl@gmail.com>
Date2012-01-29 07:31 +0100
Message-ID<5JGdnZ4wwtMsernSnZ2dnUVZ7vSdnZ2d@giganews.com>
In reply to#10692
On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
> MC wrote:
> 
>> I have searched and found references by pointy-ears and Cornfed […]
> 
> Please do not feed the troll (adjust your score-/killfile instead).

A troll, you say? Would that be the person who asked a legitimate JS
related question, or the one who tried to divert replies to
alt.my.little.pony?
I'm sure most readers of this group are able to make their own decisions
about how to score posters. We generally don't feel the need to announce
every filter adjustment in our postings, however.

Back on topic...
@OP: Yes, it is possible to use relative URLs in the XHR's open()
method. The URL will be resolved relative to the base URL of the current
document/window (see the XHR specification(s) for details).
If the current URL uses the "https" scheme, you should be fine. If the
scheme, domain, or port parts of the URL you want to request differ from
the current base URL, you're going to run into problems with the
browsers' same origin policy. But in that case, there's not much point
in using relative URLs, anyway.
There may be ways to relax this restriction, but I'd need to know more
about your use case before I can recommend one. Please also describe
what you have already tried and what did/didn't work for you.

> F'up2 where it belongs

Duly ignored.


- stefan

[toc] | [prev] | [next] | [standalone]


#10715

FromTim Streater <timstreater@greenbee.net>
Date2012-01-29 10:58 +0000
Message-ID<timstreater-5069DC.10584829012012@news.individual.net>
In reply to#10697
In article <5JGdnZ4wwtMsernSnZ2dnUVZ7vSdnZ2d@giganews.com>,
 Stefan Weiss <krewecherl@gmail.com> wrote:

> On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
> > MC wrote:
> > 
> >> I have searched and found references by pointy-ears and Cornfed […]
> > 
> > Please do not feed the troll (adjust your score-/killfile instead).
> 
> A troll, you say? Would that be the person who asked a legitimate JS
> related question, or the one who tried to divert replies to
> alt.my.little.pony?
> I'm sure most readers of this group are able to make their own decisions
> about how to score posters. We generally don't feel the need to announce
> every filter adjustment in our postings, however.
> 
> Back on topic...
> @OP: Yes, it is possible to use relative URLs in the XHR's open()
> method. The URL will be resolved relative to the base URL of the current
> document/window (see the XHR specification(s) for details).

In fact that's all I ever use.

See:

<http://www.clothears.org.uk>

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#10769

FromMC <news@aisus.com>
Date2012-01-29 21:02 -0600
Message-ID<97bfb$4f2608f0$32601a3a$3976@ALLTEL.NET>
In reply to#10715
On 1/29/2012 4:58 AM, Tim Streater wrote:
> In article <5JGdnZ4wwtMsernSnZ2dnUVZ7vSdnZ2d@giganews.com>,
> Stefan Weiss <krewecherl@gmail.com> wrote:
>
>> On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
>> > MC wrote:
>> > >> I have searched and found references by pointy-ears and Cornfed […]
>> > > Please do not feed the troll (adjust your score-/killfile instead).
>>
>> A troll, you say? Would that be the person who asked a legitimate JS
>> related question, or the one who tried to divert replies to
>> alt.my.little.pony?
>> I'm sure most readers of this group are able to make their own decisions
>> about how to score posters. We generally don't feel the need to announce
>> every filter adjustment in our postings, however.
>>
>> Back on topic...
>> @OP: Yes, it is possible to use relative URLs in the XHR's open()
>> method. The URL will be resolved relative to the base URL of the current
>> document/window (see the XHR specification(s) for details).
>
> In fact that's all I ever use.
>
> See:
>
> <http://www.clothears.org.uk>
>

Tim,

Yes Stefan pointed this out but in the example I replied to, Chrome does 
not seem to be doing this.

Thank you,
MC

[toc] | [prev] | [next] | [standalone]


#10734

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-01-29 14:57 +0100
Message-ID<1401357.V9SEqChMir@PointedEars.de>
In reply to#10697
Stefan Weiss wrote:

> On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
>> MC wrote:
>>> I have searched and found references by pointy-ears and Cornfed […]
                                            ^^^^^^^^^^^^^^^^^^^^^^^
>> Please do not feed the troll (adjust your score-/killfile instead).
> 
> A troll, you say? Would that be the person who asked a legitimate JS
> related question, or the one who tried to divert replies to
> alt.my.little.pony?

It is the person who started calling long-time contributors to this 
newsgroup names (literally), while *pretending* to not know.  As that
was obviously not obvious to some rather naive people (like you), I have 
attempted to point out the history of the OP.  As for "legitimate JS
related question": you can't be serious.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#10768

FromMC <news@aisus.com>
Date2012-01-29 21:00 -0600
Message-ID<d8997$4f26089a$32601a3a$3976@ALLTEL.NET>
In reply to#10697
On 1/29/2012 12:31 AM, Stefan Weiss wrote:
> On 2012-01-29 00:32, Thomas 'PointedEars' Lahn wrote:
>> MC wrote:
>>
>>> I have searched and found references by pointy-ears and Cornfed […]
>>
>> Please do not feed the troll (adjust your score-/killfile instead).
>
> A troll, you say? Would that be the person who asked a legitimate JS
> related question, or the one who tried to divert replies to
> alt.my.little.pony?
> I'm sure most readers of this group are able to make their own decisions
> about how to score posters. We generally don't feel the need to announce
> every filter adjustment in our postings, however.
>
> Back on topic...
> @OP: Yes, it is possible to use relative URLs in the XHR's open()
> method. The URL will be resolved relative to the base URL of the current
> document/window (see the XHR specification(s) for details).
> If the current URL uses the "https" scheme, you should be fine. If the
> scheme, domain, or port parts of the URL you want to request differ from
> the current base URL, you're going to run into problems with the
> browsers' same origin policy. But in that case, there's not much point
> in using relative URLs, anyway.
> There may be ways to relax this restriction, but I'd need to know more
> about your use case before I can recommend one. Please also describe
> what you have already tried and what did/didn't work for you.
>
>> F'up2 where it belongs
>
> Duly ignored.
>
>
> - stefan

Stefan,

I'm trying to clear up the browser mixed-mode error in the URL. The page 
is delivered via Https and all of the resources are relative addressed 
including the XmlHttpsRequest. The research I done seems to suggest I 
need to do an explicit Https XmlHttpsRequest to resolve the error.

This is what I'm using for my XmlHttpsRequest:
myXmlHttpRequest.open("POST", "/ws/webserviceXYZ.jsp");
myXmlHttpRequest.onreadystatechange = myResponse;
myXmlHttpRequest.send(myPostData);

I do not want to do the following as the domain is different in testing, 
production, and in affiliate modes:
myXmlHttpRequest.open("POST", 
"https://www.mydomain.com/ws/webserviceXYZ.jsp");

 From what you posted, the XmlHttpRequest should be defaulting to Https 
since the page was accessed from it. Chrome is complaining it is not 
though. Any help is greatly appreciated as I am not a troll. Pointy-ears 
just does not like it when one of the lesser JS smart people vocalize 
their disappointment in his depredations on their skills and character.

MC

[toc] | [prev] | [next] | [standalone]


#10957

FromStefan Weiss <krewecherl@gmail.com>
Date2012-02-01 13:34 +0100
Message-ID<auCdndgRBaLwrLTSnZ2dnUVZ8nOdnZ2d@giganews.com>
In reply to#10768
On 2012-01-30 04:00, MC wrote:
> On 1/29/2012 12:31 AM, Stefan Weiss wrote:
>> @OP: Yes, it is possible to use relative URLs in the XHR's open()
>> method. The URL will be resolved relative to the base URL of the current
>> document/window (see the XHR specification(s) for details).
>> If the current URL uses the "https" scheme, you should be fine. If the
>> scheme, domain, or port parts of the URL you want to request differ from
>> the current base URL, you're going to run into problems with the
>> browsers' same origin policy. But in that case, there's not much point
>> in using relative URLs, anyway.
...
> I'm trying to clear up the browser mixed-mode error in the URL. The page 
> is delivered via Https and all of the resources are relative addressed 
> including the XmlHttpsRequest. The research I done seems to suggest I 
> need to do an explicit Https XmlHttpsRequest to resolve the error.
> 
> This is what I'm using for my XmlHttpsRequest:
> myXmlHttpRequest.open("POST", "/ws/webserviceXYZ.jsp");
> myXmlHttpRequest.onreadystatechange = myResponse;
> myXmlHttpRequest.send(myPostData);

I can't reproduce your problem here - relative paths work just fine with
HTTPS and XML, in Chrome or any other browser. I suspect that you're
doing something else in addition to what you described, or perhaps the
server adds something automatically (like a tracker script or image, for
example).

You could try a minimal version, and see if the warning still appears.
Here's what I used for testing:
  https://secure.foo.at/ssltest/
  https://secure.foo.at/ssltest/temp.zip
If you unzip this in the document root of your server, you shouldn't see
any warnings. Can you confirm this?


- stefan

[toc] | [prev] | [next] | [standalone]


#11121

FromMC <news@aisus.com>
Date2012-02-02 08:55 -0600
Message-ID<d9d4b$4f2aa4a6$32601a3a$27019@ALLTEL.NET>
In reply to#10957
FYI,

I found it. Chrome apparently complains if an unsecure request is made 
on another page and doesn't really discriminate because its the same 
site...kind of strange I think as almost all sites make use of public 
non-secure and private secure pages.

[toc] | [prev] | [next] | [standalone]


#10789

FromMC <news@aisus.com>
Date2012-01-30 08:01 -0600
Message-ID<7129d$4f26a38c$32601a3a$8930@ALLTEL.NET>
In reply to#10692
Who is the troll?

Me who asks a question - or you who waits under the JS bridge, waiting 
for some poor unsuspecting soul to cross, and have you jump on them 
spewing your greatness and chewing them out for not being as smart as you.

I would just really like to ask questions of the group and have you not 
respond AT ALL but hey its the Internet and if you want to troll I guess 
you will. ...and what is up with the alt pony thing? You are WEIRD!

[toc] | [prev] | [next] | [standalone]


#10885

FromScott Sauyet <scott.sauyet@gmail.com>
Date2012-01-31 04:03 -0800
Message-ID<cd0bab19-953d-4376-b63d-5853b7fa0ace@l16g2000vbl.googlegroups.com>
In reply to#10789
MC wrote:
> Who is the troll?  [ ... ]

Children, children!  Play nicely together!

Mica, stop calling Thomas names.  Thomas, stop calling Mica names.

Now run along and behave!

  -- Scott

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web