Jetty 9.4.6没有为mp4发送内容类型

时间:2017-09-15 14:47:15

标签: jetty embedded-jetty

我正在运行Jetty 9.2并添加了一个显式的mime类型,它在将电影发送回客户端时设置了mp4的内容类型。这很好。然后我不得不升级到Jetty 9.4.6并将AcceptRanges设置为true,这样我就可以让Safari玩mp4了。这也很好。但是,自应用升级后,mp4的内容类型不再发送回客户端。为什么?

  // Add a handler for statically served content
  ResourceHandler resourceHandler = new ResourceHandler();

  MimeTypes mimeTypes = new MimeTypes();
  mimeTypes.addMimeMapping("mp4", "video/mp4");
  resourceHandler.setMimeTypes(mimeTypes);

  resourceHandler.setAcceptRanges(true);
  resourceHandler.setResourceBase("content");
  handlerCollection.addHandler(resourceHandler);

  // This handle will deal with unhandled requests in the server. For requests for favicon.ico, the Jetty icon is served. 
  // For all other requests a normal 404 is served.
  handlerCollection.addHandler(new DefaultHandler());

提起Issue #1823 eclipse / jetty.project

1 个答案:

答案 0 :(得分:0)

Jetty家伙回来了一个解决方法,bug将在未来修复。以下作品

CXEndCallAction *endAction = [[CXEndCallAction alloc] initWithCallUUID:callUUID];
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endAction];
// perform transaction
[self.callController requestTransaction:transaction completion:^(NSError * _Nullable error) {
       if (error != nil) {
            NSLog(TALoggerLevelCritical, @"\n\n ***** ERROR: Faield to end call transaction ****** \n\n");
        }
 }];