Not logged in : Login

About: http://ods-qa.openlinksw.com:8896/proxy-iri/2b4a2a77f044d6387a5a2b5dc1b30476aa036f42     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : sioc:Post, within Data Space : ods-qa.openlinksw.com:8896 associated with source document(s)

AttributesValues
type
Date Created
  • 2020-04-11T00:57:10.659Z
Date Modified
  • 2020-04-11T00:57:10.659Z
discourse:topic_slug
  • how-to-add-origin-header-in-content-script-ajax-call
discourse:post_number
  • 1
discourse:quote_count
  • 0
discourse:incoming_link_count
  • 1911
discourse:score
  • 9532
discourse:topic_id
  • 57683
described by
has container
content
  • proxy:entity/https/discourse.mozilla.org/t/how-to-add-origin-header-in-content-script-ajax-call/57683#content_143979

    Hi,
    Recently I am making a very simple ajax post request in content-script, for example

    Blockquote
    var xhr = new XMLHttpRequest();
    xhr.open(‘POST’, tokenUrl, true);
    xhr.setRequestHeader(‘Content-Type’, ‘application/x-www-form-urlencoded’);
    xhr.onreadystatechange = function() {
    if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
    console.log(‘Success’);
    }
    }
    xhr.send(‘a=1&b=2’);

    please note that the tokenUrl is actually on the same domain as the current tab’s domain, so actually I am not doing any CORS.
    However if I inspect the network, the Origin header is not set, I also tried on Chrome extension, the Origin header is set correctly.

    Besides, if I directly use the same ajax on Firefox tab’s console, the Origin header is set correctly

    So it seems Firefox content-script misses the Origin header, Is there any idea to add it?

    Thank you very much

discourse:reply_count
  • 0
author
is mainEntity of
Faceted Search & Find service v1.17_git55 as of Mar 01 2021


Alternative Linked Data Documents: ODE     Content Formats:       RDF       ODATA       Microdata      About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3322 as of Mar 14 2022, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (7 GB total memory)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software