felangel / bloc

A predictable state management library that helps implement the BLoC design pattern
https://bloclibrary.dev
MIT License
11.87k stars 3.4k forks source link

fix: Url path #4228

Closed B1loliddin closed 3 months ago

B1loliddin commented 3 months ago

Description You have forgotten to add "/" in url path.

Steps To Reproduce

  1. Go to: bloc/examples/flutter_weather/packages/open_meteo_api/lib/src/open_meteo_api_client.dart
  2. Click on '....'
  3. Scroll down to: 62 line
  4. See error: 'v1/forecast' needs to be -> '/v1/forecast'

Expected Behavior When I firstly saw the error, I thought that it will not request anything from anything because of the missing "/".

Screenshots

Screenshot 2024-08-14 at 18 38 19

Additional Context That's all.

chadtomkiss commented 3 months ago

@B1loliddin The Uri.https function should prepend the / automatically if it's missing. Likewise if the https:// protocol is missing in _baseUrlWeather

See https://github.com/dart-lang/sdk/blob/3217fb1590e098a4a59059c82c914152f64a8593/tests/corelib/uri_http_test.dart#L60

Were you getting a specific error returned from the request?

B1loliddin commented 3 months ago

@B1loliddin The Uri.https function should prepend the / automatically if it's missing. Likewise if the https:// protocol is missing in _baseUrlWeather

See https://github.com/dart-lang/sdk/blob/3217fb1590e098a4a59059c82c914152f64a8593/tests/corelib/uri_http_test.dart#L60

Were you getting a specific error returned from the request?

Oh,Thank you. I have just seen that the sign '/' was missing and thought that it should be fixed.