/*
(non-Javadoc)

@see
mtas.solr.handler.component.util.MtasSolrComponent#modifyRequest(org.apache
.solr.handler.component.ResponseBuilder,
org.apache.solr.handler.component.SearchComponent,
org.apache.solr.handler.component.ShardRequest)
556687
public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)
        && sreq.params.getBool(PARAM_MTAS_GROUP, false)) {
      if ((sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
        // do nothing
        // Set<String> keys = MtasSolrResultUtil
        // .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_GROUP);
        // for (String key : keys) {
        // sreq.params.remove(
        // PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_NUMBER);
        // sreq.params.remove(
        // PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_START);
        // }
      } else {
        // remove prefix for other requests
        Set<String> keys = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_GROUP);
        sreq.params.remove(PARAM_MTAS_GROUP);
        Set<String> subKeys;
        for (String key : keys) {
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_FIELD);
          sreq.params
              .remove(PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_KEY);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_NUMBER);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_START);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_QUERY_TYPE);
          sreq.params.remove(
              PARAM_MTAS_GROUP + "." + key + "." + NAME_MTAS_GROUP_QUERY_VALUE);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_PREFIX);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_IGNORE);
          sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
              + NAME_MTAS_GROUP_QUERY_MAXIMUM_IGNORE_LENGTH);
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_LEFT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_RIGHT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_LEFT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
          subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
              PARAM_MTAS_GROUP + "." + key + "."
                  + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT);
          for (String subKey : subKeys) {
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_POSITION);
            sreq.params.remove(PARAM_MTAS_GROUP + "." + key + "."
                + NAME_MTAS_GROUP_GROUPING_HIT_INSIDE_RIGHT + "." + subKey + "."
                + NAME_MTAS_GROUP_GROUPING_PREFIXES);
          }
        }
      }
    }
  }
1294971
public static void updateDirectEditFlagInSession(ServletRequest request) {

        String disabledParam = request.getParameter(CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(disabledParam)) {
            if (Boolean.parseBoolean(disabledParam)) {
                ((HttpServletRequest)request).getSession().setAttribute(
                    CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT,
                    Boolean.TRUE);
                String buttonLeft = request.getParameter(CmsGwtConstants.PARAM_BUTTON_LEFT);
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(buttonLeft)) {
                    Integer left = null;
                    try {
                        left = Integer.valueOf(buttonLeft);
                        if (left.intValue() > 0) {
                            ((HttpServletRequest)request).getSession().setAttribute(
                                CmsGwtConstants.PARAM_BUTTON_LEFT,
                                left);
                        }
                    } catch (NumberFormatException e) {
                        // malformed parameter, ignore
                    }
                }
            } else {
                ((HttpServletRequest)request).getSession().removeAttribute(CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT);
            }
        }
    }
131626
@Override
  protected TermsByQueryShardResponse shardOperation(TermsByQueryShardRequest shardRequest) throws ElasticsearchException {
    IndexService indexService = indicesService.indexServiceSafe(shardRequest.shardId().getIndex());
    IndexShard indexShard = indexService.shardSafe(shardRequest.shardId().id());
    TermsByQueryRequest request = shardRequest.request();
    OrderByShardOperation orderByOperation = OrderByShardOperation.get(request.getOrderBy(), request.maxTermsPerShard());

    SearchShardTarget shardTarget = new SearchShardTarget(clusterService.localNode().id(),
                                                          shardRequest.shardId().getIndex(),
                                                          shardRequest.shardId().id());

    ShardSearchRequest shardSearchRequest = new ShardSearchLocalRequest(request.types(), request.nowInMillis(),
                                                                        shardRequest.filteringAliases());

    SearchContext context = new DefaultSearchContext(0, shardSearchRequest, shardTarget,
      indexShard.acquireSearcher("termsByQuery"), indexService, indexShard, scriptService,
      pageCacheRecycler, bigArrays, threadPool.estimatedTimeInMillisCounter(), parseFieldMatcher,
      SearchService.NO_TIMEOUT);
    SearchContext.setCurrent(context);

    try {
      MappedFieldType fieldType = context.smartNameFieldType(request.field());
      if (fieldType == null) {
        throw new SearchContextException(context, "[termsByQuery] field '" + request.field() +
                "' not found for types " + Arrays.toString(request.types()));
      }

      IndexFieldData indexFieldData = context.fieldData().getForField(fieldType);

      BytesReference querySource = request.querySource();
      if (querySource != null && querySource.length() > 0) {
        XContentParser queryParser = null;
        try {
          queryParser = XContentFactory.xContent(querySource).createParser(querySource);
          QueryParseContext.setTypes(request.types());
          ParsedQuery parsedQuery = orderByOperation.getParsedQuery(queryParser, indexService);
          if (parsedQuery != null) {
            context.parsedQuery(parsedQuery);
          }
        }
        finally {
          QueryParseContext.removeTypes();
          if (queryParser != null) {
            queryParser.close();
          }
        }
      }

      context.preProcess();

      // execute the search only gathering the hit count and bitset for each segment
      logger.debug("{}: Executes search for collecting terms {}", Thread.currentThread().getName(),
        shardRequest.shardId());

      TermsCollector termsCollector = this.getTermsCollector(request.termsEncoding(), indexFieldData, context);
      if (request.expectedTerms() != null) termsCollector.setExpectedTerms(request.expectedTerms());
      if (request.maxTermsPerShard() != null) termsCollector.setMaxTerms(request.maxTermsPerShard());
      HitStream hitStream = orderByOperation.getHitStream(context);
      TermsSet terms = termsCollector.collect(hitStream);

      logger.debug("{}: Returns terms response with {} terms for shard {}", Thread.currentThread().getName(),
        terms.size(), shardRequest.shardId());

      return new TermsByQueryShardResponse(shardRequest.shardId(), terms);
    }
    catch (Throwable e) {
      logger.error("[termsByQuery] Error executing shard operation", e);
      throw new QueryPhaseExecutionException(context, "[termsByQuery] Failed to execute query", e);
    }
    finally {
      // this will also release the index searcher
      context.close();
      SearchContext.removeCurrent();
    }
  }
1338339
def modify_request(self, http_request=None):
    """"""
    if http_request is None:
      http_request = HttpRequest()
    if http_request.uri is None:
      http_request.uri = Uri()
    # Determine the correct scheme.
    if self.scheme:
      http_request.uri.scheme = self.scheme
    if self.port:
      http_request.uri.port = self.port
    if self.host:
      http_request.uri.host = self.host
    # Set the relative uri path
    if self.path:
      http_request.uri.path = self.path
    if self.query:
      http_request.uri.query = self.query.copy()
    return http_request
1108446
public String processSearchRequest(final SearchRequest request) {
    StringBuilder builder = new StringBuilder();
    builder.append("Search for ");
    if (request.getDatabaseCode() != null) {
      builder.append("code ");
      builder.append(request.getDatabaseCode());
    }
    if (request.getQuery() != null) {
      builder.append(" with query ");
      builder.append(request.getQuery());
    }
    if (request.getPageNumber() != null) {
      builder.append(" page ");
      builder.append(request.getPageNumber());
    }
    if (request.getMaxPerPage() != null) {
      builder.append(" limited to ");
      builder.append(request.getMaxPerPage());
      builder.append(" per page");
    }
    return builder.toString();
  }
417368
private void handleSortRequest(final Request request) {
		String sortColStr = request.getParameter(getId() + ".sort");
		String sortDescStr = request.getParameter(getId() + ".sortDesc");

		if (sortColStr != null) {
			if ("".equals(sortColStr)) {
				// Reset sort
				setSort(-1, false);
				getOrCreateComponentModel().rowIndexMapping = null;
			} else {
				try {
					int sortCol = Integer.parseInt(sortColStr);
					// Allow for column order
					int[] cols = getColumnOrder();
					if (cols != null) {
						sortCol = cols[sortCol];
					}
					boolean sortAsc = !"true".equalsIgnoreCase(sortDescStr);

					// Only process the sort request if it differs from the current sort order
					if (sortCol != getSortColumnIndex() || sortAsc != isSortAscending()) {
						sort(sortCol, sortAsc);
						setFocussed();
					}
				} catch (NumberFormatException e) {
					LOG.warn("Invalid sort column: " + sortColStr);
				}
			}
		}
	}
210118
private void addPostParams(final Request request) {
        if (roleSid != null) {
            request.addPostParam("RoleSid", roleSid);
        }

        if (lastConsumedMessageIndex != null) {
            request.addPostParam("LastConsumedMessageIndex", lastConsumedMessageIndex.toString());
        }
    }
438029
@Override
	protected void processRequest(String requestedPath, HttpServletRequest request, HttpServletResponse response,
			BundleHashcodeType bundleHashcodeType) throws IOException {

		boolean responseHeaderWritten = false;
		boolean validBundle = true;
		if (!jawrConfig.isDebugModeOn() && jawrConfig.isStrictMode()
				&& bundleHashcodeType.equals(BundleHashcodeType.INVALID_HASHCODE)) {
			validBundle = false;
		}

		// If debug mode is off, check for If-Modified-Since and
		// If-none-match headers and set response caching headers.
		if (!this.jawrConfig.isDebugModeOn()) {
			// If a browser checks for changes, always respond 'no changes'.
			if (validBundle && (null != request.getHeader(IF_MODIFIED_SINCE_HEADER)
					|| null != request.getHeader(IF_NONE_MATCH_HEADER))) {
				response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
				if (LOGGER.isDebugEnabled())
					LOGGER.debug("Returning 'not modified' header. ");
				return;
			}

			if (validBundle) {
				// Add caching headers
				setResponseHeaders(response);
			} else {

				responseHeaderWritten = illegalBundleRequestHandler.writeResponseHeader(requestedPath, request,
						response);
				if (!responseHeaderWritten) {
					// Add caching headers
					setResponseHeaders(response);
				}
			}
		}

		// Returns the real file path
		String filePath = getRealFilePath(requestedPath, bundleHashcodeType);

		try {
			if (isValidRequestedPath(filePath)
					&& (validBundle || illegalBundleRequestHandler.canWriteContent(requestedPath, request))) {

				// Set the content type
				response.setContentType(getContentType(requestedPath, request));
				writeContent(filePath, request, response);

			} else {
				if (!responseHeaderWritten) {
					LOGGER.error("Unable to load the image for the request URI : " + request.getRequestURI());
					response.sendError(HttpServletResponse.SC_NOT_FOUND);
				}
			}
		} catch (EOFException eofex) {
			LOGGER.info("Browser cut off response", eofex);
		} catch (ResourceNotFoundException e) {
			LOGGER.info("Unable to write resource " + request.getRequestURI(), e);
			response.sendError(HttpServletResponse.SC_NOT_FOUND);
		} catch (IOException ex) {
			LOGGER.error("Unable to write resource " + request.getRequestURI(), ex);
			response.sendError(HttpServletResponse.SC_NOT_FOUND);
		}

		if (LOGGER.isDebugEnabled())
			LOGGER.debug("request succesfully attended");
	}
747827
protected void requestElementUpdate (String name, int index, Object value, Object oldValue)
    {
        requestElementUpdate(name, index, value, oldValue, Transport.DEFAULT);
    }
229318
protected void updateNextIndex(MemberState member, AppendRequest request) {
    // If the match index was set, update the next index to be greater than the match index if necessary.
    if (!request.entries().isEmpty()) {
      member.setNextIndex(request.entries().get(request.entries().size()-1).getIndex()+1);
    }
  }
1006112
@Override
	protected boolean doHandleRequest(final Request request) {
		boolean selected = getRequestValue(request);
		boolean current = getValue();

		boolean changed = current != selected;

		if (changed) {
			setData(selected);
		}

		return changed;
	}
1104141
@Override
	public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
		sec.getUserProperties().put(Constants.HANDSHAKEREQUEST, request);
		super.modifyHandshake(sec, request, response);
	}
1087606
public void feedRequest(final CrawlRequest request, final boolean isCrawlSeed) {
        if (config.isOffsiteRequestFilteringEnabled()) {
            boolean inCrawlDomain = false;

            for (CrawlDomain allowedCrawlDomain : config.getAllowedCrawlDomains()) {
                if (allowedCrawlDomain.contains(request.getDomain())) {
                    inCrawlDomain = true;
                    break;
                }
            }

            if (!inCrawlDomain) {
                return;
            }
        }

        if (config.isDuplicateRequestFilteringEnabled()) {
            String urlFingerprint = createFingerprintForUrl(request.getRequestUrl());

            if (urlFingerprints.contains(urlFingerprint)) {
                return;
            }

            urlFingerprints.add(urlFingerprint);
        }

        CrawlCandidateBuilder builder = new CrawlCandidateBuilder(request);

        if (!isCrawlSeed) {
            int crawlDepthLimit = config.getMaximumCrawlDepth();
            int nextCrawlDepth = currentCandidate.getCrawlDepth() + 1;

            if (crawlDepthLimit != 0 && nextCrawlDepth > crawlDepthLimit) {
                return;
            }

            builder = builder
                    .setRefererUrl(currentCandidate.getRequestUrl())
                    .setCrawlDepth(nextCrawlDepth);
        }

        candidates.add(builder.build());
    }
33593
public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
    if ((sreq.purpose & ShardRequest.PURPOSE_GET_TOP_IDS) != 0) {
      // do nothing
    } else {
      // remove stats for other requests
      sreq.params.remove(PARAM_MTAS_STATS);
      sreq.params.remove(PARAM_MTAS_STATS_POSITIONS);
      Set<String> keys = MtasSolrResultUtil
          .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_STATS_POSITIONS);
      for (String key : keys) {
        sreq.params.remove(
            PARAM_MTAS_STATS + "." + key + "." + NAME_MTAS_STATS_POSITIONS_KEY);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_POSITIONS_FIELD);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_POSITIONS_TYPE);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_POSITIONS_MAXIMUM);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_POSITIONS_MINIMUM);
      }
      sreq.params.remove(PARAM_MTAS_STATS_TOKENS);
      keys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
          PARAM_MTAS_STATS_TOKENS);
      for (String key : keys) {
        sreq.params.remove(
            PARAM_MTAS_STATS + "." + key + "." + NAME_MTAS_STATS_TOKENS_KEY);
        sreq.params.remove(
            PARAM_MTAS_STATS + "." + key + "." + NAME_MTAS_STATS_TOKENS_FIELD);
        sreq.params.remove(
            PARAM_MTAS_STATS + "." + key + "." + NAME_MTAS_STATS_TOKENS_TYPE);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_TOKENS_MAXIMUM);
        sreq.params.remove(PARAM_MTAS_STATS + "." + key + "."
            + NAME_MTAS_STATS_TOKENS_MINIMUM);
      }
      sreq.params.remove(PARAM_MTAS_STATS_SPANS);
      keys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
          PARAM_MTAS_STATS_SPANS);
      for (String key : keys) {
        sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
            + NAME_MTAS_STATS_SPANS_KEY);
        sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
            + NAME_MTAS_STATS_SPANS_FIELD);
        sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
            + NAME_MTAS_STATS_SPANS_TYPE);
        sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
            + NAME_MTAS_STATS_SPANS_MAXIMUM);
        sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
            + NAME_MTAS_STATS_SPANS_MINIMUM);
        Set<String> subKeys = MtasSolrResultUtil
            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_STATS_SPANS
                + "." + key + "." + NAME_MTAS_STATS_SPANS_FUNCTION);
        for (String subKey : subKeys) {
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_FUNCTION + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_FUNCTION_EXPRESSION);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_FUNCTION + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_FUNCTION_KEY);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_FUNCTION + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_FUNCTION_TYPE);
        }
        subKeys = MtasSolrResultUtil.getIdsFromParameters(rb.req.getParams(),
            PARAM_MTAS_STATS_SPANS + "." + key + "."
                + NAME_MTAS_STATS_SPANS_QUERY);
        for (String subKey : subKeys) {
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_QUERY_IGNORE);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_QUERY_MAXIMUM_IGNORE_LENGTH);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_QUERY_PREFIX);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_QUERY_TYPE);
          sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
              + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
              + SUBNAME_MTAS_STATS_SPANS_QUERY_VALUE);
          Set<String> subSubKeys = MtasSolrResultUtil.getIdsFromParameters(
              rb.req.getParams(),
              PARAM_MTAS_STATS_SPANS + "." + key + "."
                  + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
                  + SUBNAME_MTAS_STATS_SPANS_QUERY_VARIABLE);
          for (String subSubKey : subSubKeys) {
            sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
                + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
                + SUBNAME_MTAS_STATS_SPANS_QUERY_VARIABLE + "." + subSubKey
                + "." + SUBNAME_MTAS_STATS_SPANS_QUERY_VARIABLE_NAME);
            sreq.params.remove(PARAM_MTAS_STATS_SPANS + "." + key + "."
                + NAME_MTAS_STATS_SPANS_QUERY + "." + subKey + "."
                + SUBNAME_MTAS_STATS_SPANS_QUERY_VARIABLE + "." + subSubKey
                + "." + SUBNAME_MTAS_STATS_SPANS_QUERY_VARIABLE_VALUE);
          }
        }
      }
    }
  }
1151995
public void modifyInstanceAttributes(ModifyVpcAttributesRequest modifyVpcAttributesRequest) {
        checkNotNull(modifyVpcAttributesRequest, "request should not be null.");
        checkStringNotEmpty(modifyVpcAttributesRequest.getVpcId(), "request vpcId should not be empty.");
        checkStringNotEmpty(modifyVpcAttributesRequest.getName(), "request name should not be empty.");
        if (Strings.isNullOrEmpty(modifyVpcAttributesRequest.getClientToken())) {
            modifyVpcAttributesRequest.setClientToken(this.generateClientToken());
        }

        InternalRequest internalRequest = this.createRequest(
                modifyVpcAttributesRequest, HttpMethodName.PUT, VPC_PREFIX, modifyVpcAttributesRequest.getVpcId());
        internalRequest.addParameter(NetworkAction.modifyAttribute.name(), null);
        internalRequest.addParameter("clientToken", modifyVpcAttributesRequest.getClientToken());
        fillPayload(internalRequest, modifyVpcAttributesRequest);
        this.invokeHttpClient(internalRequest, AbstractBceResponse.class);
    }
1228241
def modify_request(self, request):
        
        filename = URL.build(path=request.match_info['filename'], encoded=True).path
        raw_path = self._directory.joinpath(filename)
        try:
            filepath = raw_path.resolve()
            if not filepath.exists():
                # simulate strict=True for python 3.6 which is not permitted with 3.5
                raise FileNotFoundError()
        except FileNotFoundError:
            try:
                html_file = raw_path.with_name(raw_path.name + '.html').resolve().relative_to(self._directory)
            except (FileNotFoundError, ValueError):
                pass
            else:
                request.match_info['filename'] = str(html_file)
        else:
            if filepath.is_dir():
                index_file = filepath / 'index.html'
                if index_file.exists():
                    try:
                        request.match_info['filename'] = str(index_file.relative_to(self._directory))
                    except ValueError:
                        # path is not not relative to self._directory
                        pass
763162
@Override
    protected void sideEffectRequestToCancel(final BinaryRequest request) {
        super.sideEffectRequestToCancel(request);

        if (request instanceof BinaryStoreRequest) {
            ((BinaryStoreRequest) request).content().release();
        } else if (request instanceof AppendRequest) {
            ((AppendRequest) request).content().release();
        } else if (request instanceof PrependRequest) {
            ((PrependRequest) request).content().release();
        }
    }