@@ -240,7 +240,7 @@ func (i *handler) getOrHeadHandler(w http.ResponseWriter, r *http.Request) {
240240 w .Header ().Set ("X-Ipfs-Path" , contentPath .String ())
241241
242242 // Trustless gateway.
243- if ! i .isTrustedMode (r ) && ! i .isValidTrustlessRequest (contentPath , responseFormat ) {
243+ if ! i .onlyDeserializedResponses (r ) && ! i .isSerializedRequest (contentPath , responseFormat ) {
244244 err := errors .New ("only trustless requests are accepted: https://specs.ipfs.tech/http-gateways/trustless-gateway/" )
245245 webError (w , err , http .StatusNotImplemented )
246246 return
@@ -329,7 +329,7 @@ func (i *handler) addUserHeaders(w http.ResponseWriter) {
329329 }
330330}
331331
332- func (i * handler ) isTrustedMode (r * http.Request ) bool {
332+ func (i * handler ) onlyDeserializedResponses (r * http.Request ) bool {
333333 // Get the host, by default the request's Host. If this request went through
334334 // WithHostname, also check for the key in the context. If that is not present,
335335 // also check X-Forwarded-Host to support reverse proxies.
@@ -342,14 +342,14 @@ func (i *handler) isTrustedMode(r *http.Request) bool {
342342
343343 // If the gateway is defined, return whatever is set.
344344 if gw , ok := i .config .PublicGateways [host ]; ok {
345- return gw .TrustedMode
345+ return gw .DeserializedResponses
346346 }
347347
348348 // Otherwise, the default.
349- return i .config .TrustedMode
349+ return i .config .DeserializedResponses
350350}
351351
352- func (i * handler ) isValidTrustlessRequest (contentPath ipath.Path , responseFormat string ) bool {
352+ func (i * handler ) isSerializedRequest (contentPath ipath.Path , responseFormat string ) bool {
353353 // Only allow "/{#1}/{#2}"-like paths.
354354 trimmedPath := strings .Trim (contentPath .String (), "/" )
355355 pathComponents := strings .Split (trimmedPath , "/" )
0 commit comments