Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the response method consistent #373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Making the response method consistent
The methods ok, unauthorized, forbidden, notFound first have body as a parameter, and then the other parameters must be defined, 

The methods internalServerError and badRequest are different, all parameters are in {}

What you might be able to do is to change the parameter definition of the anadere method?
  • Loading branch information
wesolowski authored Aug 17, 2023
commit 753f0641d3a8b0c6bea1ac5f71050c392d8a4321
8 changes: 4 additions & 4 deletions pkgs/shelf/lib/src/response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ class Response extends Message {
/// This indicates that the server has received a malformed request.
///
/// {@macro shelf_response_body_and_encoding_param}
Response.badRequest({
Object? body,
Response.badRequest(
Object? body, {
Map<String, /* String | List<String> */ Object>? headers,
Encoding? encoding,
Map<String, Object>? context,
Expand Down Expand Up @@ -242,8 +242,8 @@ class Response extends Message {
/// from fulfilling the request.
///
/// {@macro shelf_response_body_and_encoding_param}
Response.internalServerError({
Object? body,
Response.internalServerError(
Object? body, {
Map<String, /* String | List<String> */ Object>? headers,
Encoding? encoding,
Map<String, Object>? context,
Expand Down