搜尋套件、儲存庫與 APP 分類

套件詳情v1.5.0

flutter_cors

一個用於停用和重新啟用 Flutter 的 Chrome 實例的 CORS 檢查的指令碼

macOSWindowsLinux
近 30 天下載
2210
喜歡數
197
Pub 分數
160

安裝套件

flutter pub add flutter_cors

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_cors 是一個實用工具套件,允許開發人員在 Flutter 的 Chrome 實例中暫時停用並重新啟用 CORS(跨來源資源共享)檢查,以便於開發。當測試與外部 API 或服務互動的 Web 應用程式時,這些服務不支援 CORS 標頭,此工具套件特別有用。它提供了一個簡單的指令碼介面,可修改 Chrome 瀏覽器的行為,而無需手動設定變更。該工具套件可在 macOS、Windows 和 Linux 上運行,讓主要開發平台皆可存取。

適用情境

  • 使用外部 API 測試 Web 應用
  • 在本機開發期間繞過 CORS
  • 除錯跨來源請求
  • 模擬類似生產的 API 互動
  • 實現快速前端後端整合

主要特色

  • 透過腳本停用 CORS 檢查
  • 在使用後重新啟用 CORS
  • 跨平台支援(macOS、Windows、Linux)
  • 簡單的命令列整合
  • 所需設定最少

適合對象

  • 前端開發人員測試網頁應用
  • 與第三方 API 合作的團隊
  • 開發者調試 CORS 相關問題
  • 本地開發環境
  • CI/CD 流水線與網頁測試

使用建議

  • 不適用於生產環境
  • 需要手動執行腳本
  • 如果被濫用,可能會帶來安全風險
  • 僅影響 Flutter 的 Chrome 實例
  • 應在共用環境中謹慎使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

A script to disable and re-enable CORS checks for Flutter's Chrome instances

Note

This script only disables CORS checks for local testing, and will not help with CORS issues in production. Do not ask for help with production CORS issues as that is outside the scope of this project.

Use as an executable

Installation
$ dart pub global activate flutter_cors
Usage
-e, --enable                 Enable CORS checks
-d, --disable                Disable CORS checks
-b, --disable-banner         Disable the warning banner in Chrome
-p, --flutter-path=<path>    Flutter root path (determined automatically if not specified)

$ fluttercors --disable
$ fluttercors --enable
$ fluttercors -db -p /path/to/flutter

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。