org.eclipse.jetty.server.Server.getDateField()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.eclipse.jetty.server.Server.getDateField()方法的一些代码示例,展示了Server.getDateField()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getDateField()方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:getDateField

Server.getDateField介绍

暂无

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

public void onRequest(MetaData.Request request)
{
  _requests.incrementAndGet();
  _request.setTimeStamp(System.currentTimeMillis());
  HttpFields fields = _response.getHttpFields();
  if (_configuration.getSendDateHeader() && !fields.contains(HttpHeader.DATE))
    fields.put(_connector.getServer().getDateField());
  _request.setMetaData(request);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public boolean headerComplete()
{
  _requests.incrementAndGet();
  switch (_version)
  {
    case HTTP_0_9:
      break;
    case HTTP_1_0:
      if (_configuration.getSendDateHeader())
        _response.getHttpFields().put(_connector.getServer().getDateField());
      break;
    case HTTP_1_1:
      if (_configuration.getSendDateHeader())
        _response.getHttpFields().put(_connector.getServer().getDateField());
      if (_expect)
      {
        badMessage(HttpStatus.EXPECTATION_FAILED_417,null);
        return true;
      }
      break;
    default:
      throw new IllegalStateException();
  }
  // Either handle now or wait for first content/message complete
  return _expect100Continue;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public boolean headerComplete()
{
  _requests.incrementAndGet();
  switch (_version)
  {
    case HTTP_0_9:
      break;
    case HTTP_1_0:
      if (_configuration.getSendDateHeader())
        _response.getHttpFields().put(_connector.getServer().getDateField());
      break;
    case HTTP_1_1:
      if (_configuration.getSendDateHeader())
        _response.getHttpFields().put(_connector.getServer().getDateField());
      if (_expect)
      {
        badMessage(HttpStatus.EXPECTATION_FAILED_417,null);
        return true;
      }
      break;
    default:
      throw new IllegalStateException();
  }
  // Either handle now or wait for first content/message complete
  return _expect100Continue;
}

代码示例来源:origin: Nextdoor/bender

@Override
public boolean headerComplete()
{
  _requests.incrementAndGet();
  HttpFields fields = _response.getHttpFields();
  switch (_version)
  {
    case HTTP_0_9:
      break;
    case HTTP_1_0:
      if (_configuration.getSendDateHeader() && !fields.contains(HttpHeader.DATE))
        _response.getHttpFields().add(_connector.getServer().getDateField());
      break;
    case HTTP_1_1:
      if (_configuration.getSendDateHeader() && !fields.contains(HttpHeader.DATE))
        _response.getHttpFields().add(_connector.getServer().getDateField());
      if (_expect)
      {
        badMessage(HttpStatus.EXPECTATION_FAILED_417,null);
        return true;
      }
      break;
    default:
      throw new IllegalStateException();
  }
  return true;
}

代码示例来源:origin: jenkinsci/winstone

public void onRequest(MetaData.Request request)
{
  _requests.incrementAndGet();
  _request.setTimeStamp(System.currentTimeMillis());
  HttpFields fields = _response.getHttpFields();
  if (_configuration.getSendDateHeader() && !fields.contains(HttpHeader.DATE))
    fields.put(_connector.getServer().getDateField());
  long idleTO=_configuration.getIdleTimeout();
  _oldIdleTimeout=getIdleTimeout();
  if (idleTO>=0 && _oldIdleTimeout!=idleTO)
    setIdleTimeout(idleTO);
  request.setTrailerSupplier(_trailerSupplier);
  _request.setMetaData(request);
  _request.setSecure(HttpScheme.HTTPS.is(request.getURI().getScheme()));
  notifyRequestBegin(_request);
  if (LOG.isDebugEnabled())
    LOG.debug("REQUEST for {} on {}{}{} {} {}{}{}",request.getURIString(),this,System.lineSeparator(),
        request.getMethod(),request.getURIString(),request.getHttpVersion(),System.lineSeparator(),
        request.getFields());
}

相关文章