Skip to content

Commit

Permalink
Support POST requests on /api/v2/CrawlByWarcFilename
Browse files Browse the repository at this point in the history
This is to workaround hitting request size limits when lookup a lot of files in one go.
  • Loading branch information
ato committed Jul 12, 2023
1 parent 53b402f commit fc16685
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ui/src/bamboo/api/ApiV2Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import bamboo.app.Bamboo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@Controller
public class ApiV2Controller {
private final Bamboo wa;
Expand All @@ -17,7 +18,8 @@ public ApiV2Controller(Bamboo wa) {
}

// Used by pandas-admin for the pages feature
@GetMapping("/api/v2/CrawlsByWarcFilename")
// supports both GET and POST in order to allow larger requests
@RequestMapping(value = "/api/v2/CrawlsByWarcFilename", method = {GET, POST})
@ResponseBody
public List<ApiDAO.CrawlsByFilename> crawlsByWarcFilename(@RequestParam("filename") List<String> filenames) {
return wa.dao.api().crawlsByWarcFilename(filenames);
Expand Down

0 comments on commit fc16685

Please sign in to comment.