本文整理了Java中org.eclipse.jetty.server.Request.setSecure
方法的一些代码示例,展示了Request.setSecure
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setSecure
方法的具体详情如下:
包路径:org.eclipse.jetty.server.Request
类名称:Request
方法名:setSecure
暂无
代码示例来源:origin: line/armeria
private static void fillRequest(
ServiceRequestContext ctx, AggregatedHttpMessage aReq, Request jReq) {
jReq.setDispatcherType(DispatcherType.REQUEST);
jReq.setAsyncSupported(false, "armeria");
jReq.setSecure(ctx.sessionProtocol().isTls());
jReq.setMetaData(toRequestMetadata(ctx, aReq));
final HttpData content = aReq.content();
if (!content.isEmpty()) {
jReq.getHttpInput().addContent(new Content(ByteBuffer.wrap(
content.array(), content.offset(), content.length())));
}
jReq.getHttpInput().eof();
}
代码示例来源:origin: org.simplericity.jettyconsole/jetty-console-core
@Override
public void customize(Connector connector, HttpConfiguration channelConfig, Request request) {
request.setScheme(URIUtil.HTTPS);
request.setSecure(true);
}
});
代码示例来源:origin: stackoverflow.com
import java.io.IOException;
import javax.servlet.ServletException;
import org.apache.catalina.Valve;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;
public class SecureRequestModifyingValve extends ValveBase
{
private static final String LB_HTTPS_HEADER = "Front-End-Https";
@Override
public void invoke(final Request request, final Response response) throws IOException, ServletException
{
final String httpsHeader = request.getHeader(LB_HTTPS_HEADER);
request.setSecure(httpsHeader != null && httpsHeader.equalsIgnoreCase("on"));
getNext().invoke(request, response);
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
/**
* Customizes the request attributes for general secure settings.
* The default impl calls {@link Request#setSecure(boolean)} with true
* and sets a response header if the Strict-Transport-Security options
* are set.
* @param request the request being customized
*/
protected void customizeSecure(Request request)
{
request.setSecure(true);
if (_stsField!=null)
request.getResponse().getHttpFields().add(_stsField);
}
代码示例来源:origin: jenkinsci/winstone
/**
* Customizes the request attributes for general secure settings.
* The default impl calls {@link Request#setSecure(boolean)} with true
* and sets a response header if the Strict-Transport-Security options
* are set.
* @param request the request being customized
*/
protected void customizeSecure(Request request)
{
request.setSecure(true);
if (_stsField!=null)
request.getResponse().getHttpFields().add(_stsField);
}
代码示例来源:origin: Nextdoor/bender
@Override
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
if (request.getHttpChannel().getEndPoint() instanceof DecryptedEndPoint)
{
request.setScheme(HttpScheme.HTTPS.asString());
request.setSecure(true);
SslConnection.DecryptedEndPoint ssl_endp = (DecryptedEndPoint)request.getHttpChannel().getEndPoint();
SslConnection sslConnection = ssl_endp.getSslConnection();
SSLEngine sslEngine=sslConnection.getSSLEngine();
customize(sslEngine,request);
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
if (request.getHttpChannel().getEndPoint() instanceof DecryptedEndPoint)
{
request.setScheme(HttpScheme.HTTPS.asString());
request.setSecure(true);
SslConnection.DecryptedEndPoint ssl_endp = (DecryptedEndPoint)request.getHttpChannel().getEndPoint();
SslConnection sslConnection = ssl_endp.getSslConnection();
SSLEngine sslEngine=sslConnection.getSSLEngine();
customize(sslEngine,request);
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
if (request.getHttpChannel().getEndPoint() instanceof DecryptedEndPoint)
{
request.setScheme(HttpScheme.HTTPS.asString());
request.setSecure(true);
SslConnection.DecryptedEndPoint ssl_endp = (DecryptedEndPoint)request.getHttpChannel().getEndPoint();
SslConnection sslConnection = ssl_endp.getSslConnection();
SSLEngine sslEngine=sslConnection.getSSLEngine();
customize(sslEngine,request);
}
}
代码示例来源: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());
}
代码示例来源:origin: jenkinsci/winstone
if (isSslIsSecure())
request.setSecure(true);
request.setScheme(config.getSecureScheme());
if (isSslIsSecure())
request.setSecure(true);
request.setScheme(config.getSecureScheme());
request.setSecure(true);
request.setSecure(true);
request.setSecure(true);
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
request.setSecure(true);
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
request.setSecure(true);
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
request.setSecure(true);
代码示例来源:origin: Nextdoor/bender
request.setSecure(true);
内容来源于网络,如有侵权,请联系作者删除!