Lines Matching +full:non +full:- +full:empty

1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
78 if (!file.contentType.empty()) in handleStaticAsset()
80 asyncResp->res.addHeader(boost::beast::http::field::content_type, in handleStaticAsset()
84 if (!file.contentEncoding.empty()) in handleStaticAsset()
86 asyncResp->res.addHeader(boost::beast::http::field::content_encoding, in handleStaticAsset()
90 if (!file.etag.empty()) in handleStaticAsset()
92 asyncResp->res.addHeader(boost::beast::http::field::etag, file.etag); in handleStaticAsset()
99 asyncResp->res.addHeader(boost::beast::http::field::cache_control, in handleStaticAsset()
100 "max-age=31556926, immutable"); in handleStaticAsset()
107 asyncResp->res.result(boost::beast::http::status::not_modified); in handleStaticAsset()
112 if (asyncResp->res.openFile(file.absolutePath) != crow::OpenCode::Success) in handleStaticAsset()
115 asyncResp->res.result( in handleStaticAsset()
126 {{".css", "text/css;charset=UTF-8"}, in getFiletypeForExtension()
127 {".eot", "application/vnd.ms-fontobject"}, in getFiletypeForExtension()
129 {".html", "text/html;charset=UTF-8"}, in getFiletypeForExtension()
130 {".ico", "image/x-icon"}, in getFiletypeForExtension()
133 {".js", "application/javascript;charset=UTF-8"}, in getFiletypeForExtension()
137 …/ https://stackoverflow.com/questions/19911929/what-mime-type-should-i-use-for-javascript-source-m… in getFiletypeForExtension()
139 {".png", "image/png;charset=UTF-8"}, in getFiletypeForExtension()
141 {".ttf", "application/x-font-ttf"}, in getFiletypeForExtension()
142 {".woff", "application/x-font-woff"}, in getFiletypeForExtension()
143 {".woff2", "application/x-font-woff2"}, in getFiletypeForExtension()
154 "Cannot determine content-type for file with extension {}", in getFiletypeForExtension()
158 return contentType->second; in getFiletypeForExtension()
166 file.absolutePath.string().substr(rootpath.size() - 1)); in addFile()
174 // Use the non-gzip version for determining content type in addFile()
181 // Use the non-zstd version for determining content type in addFile()
191 if (webpath.string().empty() || webpath.string().back() != '/') in addFile()
193 // insert the non-directory version of this path in addFile()
237 // non-gzipped version. To avoid duplicated routes, we need to make sure we in requestRoutes()
239 // than the non gzipped path, if we sort in descending order, we should be in requestRoutes()