Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jul 9, 2023
2 parents 9962016 + 26915c2 commit fd8ed3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions lib/data/models/document_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,14 @@ abstract class DocumentEntity extends Object

String get downloadUrl => '/documents/$hash';

bool get isImage =>
name.endsWith('.png') || name.endsWith('.jpg') || name.endsWith('.jpeg');
bool get isImage {
final fileName = name.toLowerCase();
return fileName.endsWith('.png') ||
fileName.endsWith('.jpg') ||
fileName.endsWith('.jpeg') ||
fileName.endsWith('.bmp') ||
fileName.endsWith('.webp');
}

int compareTo(DocumentEntity document,
[String sortField, bool sortAscending = true]) {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/web_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Map<String, String> _getHeaders(
secret = Config.API_SECRET;
}
final headers = {
'X-CLIENT': getPlatformName(),
'X-CLIENT-PLATFORM': getPlatformName(),
'X-CLIENT-VERSION': kClientVersion,
'X-API-SECRET': secret,
'X-Requested-With': 'XMLHttpRequest',
Expand Down
2 changes: 1 addition & 1 deletion macos/DashboardWidget/DashboardWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ struct ApiService {
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue(apiToken, forHTTPHeaderField: "X-API-Token")
request.addValue("macOS Widget", forHTTPHeaderField: "X-CLIENT")
request.addValue("macOS Widget", forHTTPHeaderField: "X-CLIENT-PLATFORM")

do {
let (data, response) = try await URLSession.shared.data(for: request)
Expand Down

0 comments on commit fd8ed3a

Please sign in to comment.