Skip to content

[bug] HTTP scope can't allow all URIs #3507

@elvinaspredkelis

Description

@elvinaspredkelis

Describe the bug

Hello 👋

It is seemingly impossible allow all URIs to pass through the Tauri's HTTP API.

I do understand this is a security measure, however, some apps rely on allowing all URIs. E.g. developer tooling. Or, the URIs are validated somewhere else, like a backend server.

Reproduction

  1. Add required attributes to the allowlist in tauri.conf.json:
"http": {
        "all": true,
        "request": true,
        "scope": ["https://*", "http://*"]
      }
  1. Try to perform any HTTP request via the Tauri API
  2. Should get this error url not allowed on the configured scope

Expected behavior

It would be expected that such scopes would allow all URIs to pass through the scope validation:

  • http://*
  • https://*
  • Or perhaps work like shell scopes and allow either true or ^https?:// RegEx.

Platform and versions

Operating System - Mac OS, version 12.0.1 X64

Node.js environment
  Node.js - 16.6.2
  @tauri-apps/cli - 1.0.0-rc.4
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 8.3.0
  pnpm - Not installed
  yarn - 1.22.11

Rust environment
  rustup - 1.24.3
  rustc - 1.58.1
  cargo - 1.58.0
  toolchain - stable-x86_64-apple-darwin 

App directory structure
/dist
/node_modules
/public
/src-tauri
/.git
/.vscode
/src

App
  tauri - 1.0.0-rc.2
  tauri-build - 1.0.0-rc.1
  tao - 0.6.2
  wry - 0.13.1
  build-type - bundle
  CSP - default-src 'self'
  distDir - ../dist
  devPath - http://localhost:8080/
  framework - Vue.js

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions