cfug / dio

A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
https://dio.pub
MIT License
12.43k stars 1.51k forks source link

Duplicate the base url #2283

Open tuyen3962 opened 4 weeks ago

tuyen3962 commented 4 weeks ago

Package

dio

Version

5.5.0+1

Operating-System

Android, iOS

Adapter

Default Dio

Output of flutter doctor -v

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.4 23E214 darwin-arm64, locale
    en-VN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✗] Chrome - develop for the web (Cannot find Chrome executable at
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.0)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Dart Version

No response

Steps to Reproduce

  1. I set the base url in dio.
  2. But sometime call api, it will duplicate the base url. However sometime it does not happen.

Expected Result

No duplicate base url

Actual Result

Sometime it duplicate the base url when calling api

tuyen3962 commented 4 weeks ago

Screenshot 2024-08-15 at 09 38 45

AlexV525 commented 4 weeks ago

Please provide a minimal standalone runnable reproducible example.

tuyen3962 commented 3 weeks ago

When I call two API at the same time, it will have the base url in the path of second API. Now the first time I call login API, and the second time I call API to update my fcm token to profile. In the second time, it will call api twice and the last time of api will be duplicate. Please check it for me.

AlexV525 commented 3 weeks ago

Please provide a minimal standalone runnable reproducible example.