public class DefaultPreviewSandboxWebRequestResolver extends Object implements PreviewSandboxWebRequestResolver
PreviewSandboxWebRequestResolver
that resolves a preview
sandbox id String
from a NativeWebRequest
.
This resolver will look for a header named getHeaderName()
to detect a preview sandbox
id String
. If a sandbox id is found, it will return i.
If this resolver either fails to detect a preview sandbox id, then it will return null
.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HEADER_NAME |
Constructor and Description |
---|
DefaultPreviewSandboxWebRequestResolver() |
Modifier and Type | Method and Description |
---|---|
protected String |
getHeaderName() |
protected String |
parseRequestHeader(org.springframework.web.context.request.NativeWebRequest webRequest) |
String |
resolve(org.springframework.web.context.request.NativeWebRequest webRequest)
Attempts to resolve a preview sandbox id for the provided request.
|
void |
setHeaderName(String headerName) |
public static final String DEFAULT_HEADER_NAME
public DefaultPreviewSandboxWebRequestResolver()
public String resolve(org.springframework.web.context.request.NativeWebRequest webRequest)
PreviewSandboxWebRequestResolver
If no preview sandbox id is found this method is expected to return null
.
resolve
in interface PreviewSandboxWebRequestResolver
webRequest
- the current web requestnull
protected String parseRequestHeader(org.springframework.web.context.request.NativeWebRequest webRequest)
protected String getHeaderName()
public void setHeaderName(String headerName)
Copyright © 2021. All rights reserved.