mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
fix: Add forced JSON content type to REST APIs
This commit is contained in:
parent
3a0221e8b1
commit
f81bf968fd
|
@ -21,7 +21,11 @@ class CloudflareApi extends DnsProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -21,7 +21,11 @@ class DesecApi extends DnsProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -24,7 +24,11 @@ class DigitalOceanDnsApi extends DnsProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -25,7 +25,11 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().serverProviderKey;
|
||||
assert(token != null);
|
||||
|
|
|
@ -27,7 +27,11 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
|
||||
@override
|
||||
BaseOptions get options {
|
||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||
final BaseOptions options = BaseOptions(
|
||||
baseUrl: rootAddress,
|
||||
contentType: Headers.jsonContentType,
|
||||
responseType: ResponseType.json,
|
||||
);
|
||||
if (isWithToken) {
|
||||
final String? token = getIt<ApiConfigModel>().serverProviderKey;
|
||||
assert(token != null);
|
||||
|
|
Loading…
Reference in a new issue