001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.http; 014 015/** 016 * Represents a parsed <l>Server</l> HTTP response header. 017 * 018 * <p> 019 * A name for the server. 020 * 021 * <h5 class='figure'>Example</h5> 022 * <p class='bcode'> 023 * Server: Apache/2.4.1 (Unix) 024 * </p> 025 * 026 * <h5 class='topic'>RFC2616 Specification</h5> 027 * 028 * The Server response-header field contains information about the software used by the origin server to handle the 029 * request. 030 * The field can contain multiple product tokens (section 3.8) and comments identifying the server and any significant 031 * sub-products. 032 * The product tokens are listed in order of their significance for identifying the application. 033 * 034 * <p class='bcode'> 035 * Server = "Server" ":" 1*( product | comment ) 036 * </p> 037 * 038 * <p> 039 * Example: 040 * <p class='bcode'> 041 * Server: CERN/3.0 libwww/2.17 042 * </p> 043 * 044 * <p> 045 * If the response is being forwarded through a proxy, the proxy application MUST NOT modify the Server response-header. 046 * Instead, it SHOULD include a Via field (as described in section 14.45). 047 * 048 * <p> 049 * Note: Revealing the specific software version of the server might allow the server machine to become more vulnerable 050 * to attacks against software that is known to contain security holes. 051 * Server implementors are encouraged to make this field a configurable option. 052 * 053 * <h5 class='section'>See Also:</h5> 054 * <ul class='doctree'> 055 * <li class='extlink'><a class='doclink' href='https://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a> 056 * </ul> 057 */ 058public final class Server extends HeaderString { 059 060 /** 061 * Returns a parsed <code>Server</code> header. 062 * 063 * @param value The <code>Server</code> header string. 064 * @return The parsed <code>Server</code> header, or <jk>null</jk> if the string was null. 065 */ 066 public static Server forString(String value) { 067 if (value == null) 068 return null; 069 return new Server(value); 070 } 071 072 private Server(String value) { 073 super(value); 074 } 075}