Dart机架和rpc包之间的不兼容?(';访问控制请求方法';标头)
shelf和rpc包之间似乎不兼容 在rpc[0.4.1]config/api.dart中:HandleHttpOptions请求需要 “访问控制请求方法”标题为列表:Dart机架和rpc包之间的不兼容?(';访问控制请求方法';标头),dart,dart-shelf,dart-rpc,Dart,Dart Shelf,Dart Rpc,shelf和rpc包之间似乎不兼容 在rpc[0.4.1]config/api.dart中:HandleHttpOptions请求需要 “访问控制请求方法”标题为列表: Future<HttpApiResponse> handleHttpOptionsRequest( ParsedHttpApiRequest request) async { var requestedHttpMethods = request.headers['acces
Future<HttpApiResponse> handleHttpOptionsRequest(
ParsedHttpApiRequest request) async {
var requestedHttpMethods = request.headers['access-control-request-method'];
List<String> allowed = [];
assert('OPTIONS'.allMatches(request.methodKey).length == 1);
if (requestedHttpMethods != null) {
requestedHttpMethods.forEach((httpMethod) {
var methodKey =
request.methodKey.replaceFirst('OPTIONS', httpMethod);
final List<ApiConfigMethod> methods = _methodMap[methodKey];
if (methods != null) {
for (var method in methods) {
if (method.matches(request)) {
allowed.add(httpMethod);
break;
}
}
}
});
}
未来HandleHttpOptions请求(
ParsedHttpApiRequest(请求)异步{
var requestedHttpMethods=request.headers['access-control-request-method'];
允许列表=[];
assert('OPTIONS'.allMatches(request.methodKey).length==1);
if(requestedHttpMethods!=null){
requestedHttpMethods.forEach((httpMethod){
var方法键=
request.methodKey.replaceFirst('OPTIONS',httpMethod);
最终列表这是RPC包中的一个错误。我将尽快修复此错误并发布新版本的RPC包
欢迎您在github下提交此类问题,网址为:
干杯,
/gustav这是RPC包中的一个错误。我将尽快修复此错误并发布RPC包的新版本
欢迎您在github下提交此类问题,网址为:
干杯,
/古斯塔夫O.K.完成:感谢您的快速回复!现在应该可以修复了。如果您可以尝试一下并让我知道这将非常好。您需要进行“发布升级”以获得最新版本(v0.4.2)。前面提到的问题似乎已经解决。谢谢!出现了一个新问题=>请参阅问题更新出现的新问题:很抱歉,缺少适当的测试。现在应该解决它(rpc v0.4.3)。请让我知道它是如何为您工作的。好的。完成:感谢您的快速回复!现在应该已修复。如果您可以尝试并让我知道这将是伟大的。您需要进行“发布升级”以获得最新版本(v0.4.2)。前面提到的问题似乎已经解决。谢谢!出现了一个新问题=>请参阅问题更新出现的新问题:很抱歉没有进行适当的测试。现在应该解决它(rpc v0.4.3)。请让我知道它是如何为您工作的。
Error thrown by handler.
type 'List' is not a subtype of type 'String' of 'value'.
package:collection/src/canonicalized_map.dart 66:30 CanonicalizedMap.[]=
package:collection/src/canonicalized_map.dart 71:39 CanonicalizedMap.addAll.<fn>
dart:collection _CompactLinkedHashMap.forEach
package:collection/src/canonicalized_map.dart 71:18 CanonicalizedMap.addAll
package:collection/src/canonicalized_map.dart 57:11 CanonicalizedMap.CanonicalizedMap.from
package:shelf/src/response.dart 215:9 Response.Response
package:shelf_rpc/shelf_rpc.dart 18:24 createRpcHandler.<fn>.<fn>