Class HotlinkingManagerDefault
java.lang.Object
org.spincast.core.routing.hotlinking.HotlinkingManagerDefault
- All Implemented Interfaces:
HotlinkingManager
Default
HotlinkingManager
. Will return
a FORBIDDEN
status code.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetHotlinkingStategy
(Object serverExchange, URI resourceURI, StaticResource<?> resource) The strategy to use to protect the hotlinked resource.getRedirectUrl
(Object serverExchange, URI resourceURI, StaticResource<?> resource) The URL to redirect the protected resource when theHotlinkingManager.getHotlinkingStategy(Object, URI, StaticResource)
returnsHotlinkingStategy.REDIRECT
.protected SpincastConfig
protected boolean
isHostAndRefererValid
(Object serverExchange, URI resourceUri, String requestOriginHeader, String requestRefererHeader, StaticResource<?> resource) boolean
mustHotlinkingProtect
(Object serverExchange, URI resourceUri, String requestOriginHeader, String requestRefererHeader, StaticResource<?> resource) This must returntrue
if the current resource has to be hotlinking protected.
-
Constructor Details
-
HotlinkingManagerDefault
-
-
Method Details
-
getSpincastConfig
-
getHotlinkingStategy
public HotlinkingStategy getHotlinkingStategy(Object serverExchange, URI resourceURI, StaticResource<?> resource) Description copied from interface:HotlinkingManager
The strategy to use to protect the hotlinked resource.- Specified by:
getHotlinkingStategy
in interfaceHotlinkingManager
-
getRedirectUrl
Description copied from interface:HotlinkingManager
The URL to redirect the protected resource when theHotlinkingManager.getHotlinkingStategy(Object, URI, StaticResource)
returnsHotlinkingStategy.REDIRECT
. Won't be used otherwise.- Specified by:
getRedirectUrl
in interfaceHotlinkingManager
-
mustHotlinkingProtect
public boolean mustHotlinkingProtect(Object serverExchange, URI resourceUri, String requestOriginHeader, String requestRefererHeader, StaticResource<?> resource) Description copied from interface:HotlinkingManager
This must returntrue
if the current resource has to be hotlinking protected.- Specified by:
mustHotlinkingProtect
in interfaceHotlinkingManager
-
isHostAndRefererValid
protected boolean isHostAndRefererValid(Object serverExchange, URI resourceUri, String requestOriginHeader, String requestRefererHeader, StaticResource<?> resource)
-