mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 10:49:49 +08:00
disabled ssl bypass for web
This commit is contained in:
@@ -14,6 +14,7 @@ const kAssetSendingLottie = "assets/sending.json";
|
|||||||
const kAssetSavingLottie = "assets/saving.json";
|
const kAssetSavingLottie = "assets/saving.json";
|
||||||
const kAssetSavedLottie = "assets/completed.json";
|
const kAssetSavedLottie = "assets/completed.json";
|
||||||
|
|
||||||
|
final kIsBrowser = kIsWeb;
|
||||||
final kIsMacOS = !kIsWeb && Platform.isMacOS;
|
final kIsMacOS = !kIsWeb && Platform.isMacOS;
|
||||||
final kIsWindows = !kIsWeb && Platform.isWindows;
|
final kIsWindows = !kIsWeb && Platform.isWindows;
|
||||||
final kIsLinux = !kIsWeb && Platform.isLinux;
|
final kIsLinux = !kIsWeb && Platform.isLinux;
|
||||||
|
|||||||
@@ -39,16 +39,19 @@ class SettingsPage extends ConsumerWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: [
|
children: [
|
||||||
SwitchListTile(
|
|
||||||
hoverColor: kColorTransparent,
|
!kIsBrowser ?SwitchListTile(
|
||||||
title: const Text('Disabling SSL verification'),
|
hoverColor: kColorTransparent,
|
||||||
subtitle: Text(
|
title: const Text('Disabling SSL verification'),
|
||||||
'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}'),
|
subtitle: Text(
|
||||||
value: settings.isSSLDisabled,
|
'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}',
|
||||||
onChanged: (bool? value) {
|
),
|
||||||
ref.read(settingsProvider.notifier).update(isSSLDisabled: value);
|
value: settings.isSSLDisabled,
|
||||||
},
|
onChanged: (bool? value) {
|
||||||
),
|
ref.read(settingsProvider.notifier).update(isSSLDisabled: value ?? false);
|
||||||
|
},
|
||||||
|
) :const SizedBox.shrink(),
|
||||||
|
|
||||||
SwitchListTile(
|
SwitchListTile(
|
||||||
hoverColor: kColorTransparent,
|
hoverColor: kColorTransparent,
|
||||||
title: const Text('Switch Theme Mode'),
|
title: const Text('Switch Theme Mode'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:apidash_core/apidash_core.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jinja/jinja.dart' as jj;
|
import 'package:jinja/jinja.dart' as jj;
|
||||||
//import 'package:printing/printing.dart';
|
import 'package:printing/printing.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:vector_graphics_compiler/vector_graphics_compiler.dart';
|
import 'package:vector_graphics_compiler/vector_graphics_compiler.dart';
|
||||||
import 'error_message.dart';
|
import 'error_message.dart';
|
||||||
@@ -79,21 +79,21 @@ class _PreviewerState extends State<Previewer> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) {
|
if (widget.type == kTypeApplication && widget.subtype == kSubTypePdf) {
|
||||||
// return PdfPreview(
|
return PdfPreview(
|
||||||
// build: (_) => widget.bytes,
|
build: (_) => widget.bytes,
|
||||||
// useActions: false,
|
useActions: false,
|
||||||
// onError: (context, error) {
|
onError: (context, error) {
|
||||||
// return ErrorMessage(
|
return ErrorMessage(
|
||||||
// message: errorTemplate.render({
|
message: errorTemplate.render({
|
||||||
// "showRaw": false,
|
"showRaw": false,
|
||||||
// "showContentType": false,
|
"showContentType": false,
|
||||||
// "type": kSubTypePdf,
|
"type": kSubTypePdf,
|
||||||
// }),
|
}),
|
||||||
// );
|
);
|
||||||
// },
|
},
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
if (widget.type == kTypeAudio) {
|
if (widget.type == kTypeAudio) {
|
||||||
return Uint8AudioPlayer(
|
return Uint8AudioPlayer(
|
||||||
bytes: widget.bytes,
|
bytes: widget.bytes,
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import 'package:apidash_core/utils/http_request_utils.dart';
|
import 'package:apidash_core/utils/http_request_utils.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
import '';
|
||||||
|
|
||||||
class HttpClientManager {
|
class HttpClientManager {
|
||||||
static final HttpClientManager _instance = HttpClientManager._internal();
|
static final HttpClientManager _instance = HttpClientManager._internal();
|
||||||
@@ -15,7 +17,7 @@ class HttpClientManager {
|
|||||||
HttpClientManager._internal();
|
HttpClientManager._internal();
|
||||||
|
|
||||||
http.Client createClient(String requestId,{bool noSSL = false}) {
|
http.Client createClient(String requestId,{bool noSSL = false}) {
|
||||||
final client = noSSL ? createHttpClientWithNoSSL() :http.Client();
|
final client = noSSL && !kIsWeb ? createHttpClientWithNoSSL() :http.Client();
|
||||||
_clients[requestId] = client;
|
_clients[requestId] = client;
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user