Class ProxyUtils
java.lang.Object
org.apache.hadoop.yarn.server.webproxy.ProxyUtils
Class containing general purpose proxy utilities
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidOutput 404 with appropriate message.static voidrejectNonHttpRequests(javax.servlet.ServletRequest req) Reject any request that isn't from an HTTP servletstatic voidsendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target) Handle redirects with a status code that can in future support verbs other than GET, thus supporting full REST functionality.
-
Field Details
-
E_HTTP_HTTPS_ONLY
- See Also:
-
LOCATION
- See Also:
-
-
Constructor Details
-
ProxyUtils
public ProxyUtils()
-
-
Method Details
-
sendRedirect
public static void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target) throws IOException Handle redirects with a status code that can in future support verbs other than GET, thus supporting full REST functionality.The target URL is included in the redirect text returned
At the end of this method, the output stream is closed.
- Parameters:
request- request (hence: the verb and any other information relevant to a redirect)response- the responsetarget- the target URL -unencoded- Throws:
IOException
-
notFound
public static void notFound(javax.servlet.http.HttpServletResponse resp, String message) throws IOException Output 404 with appropriate message.- Parameters:
resp- the http response.message- the message to include on the page.- Throws:
IOException- on any error.
-
rejectNonHttpRequests
public static void rejectNonHttpRequests(javax.servlet.ServletRequest req) throws javax.servlet.ServletException Reject any request that isn't from an HTTP servlet- Parameters:
req- request- Throws:
javax.servlet.ServletException- if the request is of the wrong type
-