语言

Menu
Sites
Language
POST request contains 'Origin: file://' header

We are creating a react-native-web project configured with these relevant config properties:

 

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns="http ://www.w3.org/ns/widgets" xmlns:tizen="http ://tizen.org/ns/widgets" id="<redacted>" version="0.0.1" viewmodes="maximized">

    <access origin="*" subdomains="true"></access>

    <tizen:allow-navigation>*</tizen:allow-navigation>

    <tizen:application id="<redacted>" package="<redacted>" required_version="3.0"/>

    <content src="index.html"/>

    <tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>

    <feature name="http ://tizen.org/feature/screen.size.normal.1080.1920"/>

    <feature name="http ://tizen.org/feature/network.internet"/>

    <icon src="icon.png"/>

    <tizen:privilege name="http ://tizen.org/privilege/tv.inputdevice"/>

    <tizen:privilege name="http ://tizen.org/privilege/tv.window"/>

    <tizen:privilege name="http ://tizen.org/privilege/volume.set"/>

    <tizen:privilege name="http ://tizen.org/privilege/internet"/>

    <tizen:privilege name="http ://tizen.org/privilege/filesystem.read"/>

    <tizen:privilege name="http ://tizen.org/privilege/filesystem.write"/>

    <tizen:profile name="tv-samsung"/>

    <tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>

</widget>

 

Running this app on simulator, emulator or physical TV device, GET requests succeed but POST requests contain a 'Origin: file://' header. This is not accepted by the back-end:

  1. Accept:
    application/json, text/plain, */*
  2. Content-Type:
    application/json
  3. Origin:
    file://
  4. User-Agent:
    Mozilla/5.0 (SMART-TV; LINUX; Tizen 4.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 TV Safari/537.36

Our project is a react-native-web app using Axios as network library.

How can we exclude this Origin header from POST requests?

编辑者为: Tom Van Laerhoven 27 6月, 2019