Baseflow / Baseflow/flutter_cache_manager
[Bug] Getting "HttpException: Invalid statusCode: 403" error
- Ngôn ngữ chính
- Dart
- Star
- 809
- Fork
- 510
- Merge trung bình
- 6 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
## 🐛 Bug Report - Getting "HttpException: Invalid statusCode: 403" error
### Expected behavior
- I am trying to cache a video file from an open https url:
- - [https://cdn-animation.artstation.com/p/video_sources/000/629/776/shield-05-video.mp4]()
- **The error:** `HttpException: Invalid statusCode: 403`
- As far as I know, no headers are needed for that url.
- The file size is 13.4 MB.
- I will then use that cached file for playing videos from URLs.
- Actually, I am already doing that and it works as expected for this video url:
- - [https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4]()
- **Important:** Even though I can't cache the video from the 1st url I provided, the Video Player plugin can successfully play it. So the url is working indeed.
### The code is long but here are the important part.
```dart
FileInfo? _fileInfo;
DefaultCacheManager _cacheManager = DefaultCacheManager();
_fileInfo = await _cacheManager.downloadFile(videoUrl, force: true);
// Also tried with --> force: false
// I use *await* but I know it is optional, in my case I need that.
if (_fileInfo == null) {
videoPlayerController = VideoPlayerController.network(videoUrl);
// When the file cannot be cached, the video is played from .network()
} else {
videoPlayerController = VideoPlayerController.file(_fileInfo.file);
// When the file is cached, the video is played from .file()
}
```
### I have also tried adding the key for allowing arbitrary loads on iOS --> NSAllowsArbitraryLoads
```
NSAppTransportSecurity
NSAllowsArbitraryLoads
```
### Version:
**flutter:** `2.10.1`
**flutter_cache_manager:** `^3.3.0`
### Platform:
- iOS (both device and simulator) - (tried on different iPhones) - (tried on release - debug modes)
Hướng dẫn đóng góp
Hướng nghiên cứu
Không có tệp hoặc kiểm thử nào trong repository được nêu tên. Hãy bắt đầu từ lệnh gọi downloadFile trong báo cáo và theo dõi cách cache-manager xử lý phản hồi HTTP của URL ArtStation được cung cấp, sau đó so sánh với URL video mẫu Flutter trên iOS. Hoàn tất có nghĩa là tái hiện được hành vi 403 và xác định được hành vi phù hợp của cache-manager đối với phản hồi đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- dart, flutter
- Lĩnh vực
- mobile-dev, networking
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100