intoResponse method

  1. @override
Response intoResponse()
override

Builds the response for this value.

Implementation

@override
Response intoResponse() {
  return Response(
    status,
    // A newline in `Location` would end the header and start another, and a
    // redirect target is exactly the kind of value built from user input.
    headers: {'location': location.replaceAll(RegExp(r'[\r\n\x00]'), '')},
  );
}