Guest User

Untitled

a guest
Feb 16th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. private static HarEntry getRequest(String href) {
  2. if(!recallProxyUsed()) {
  3. System.out.println("Proxy not recording, skipping fetch");
  4. return null;
  5. }
  6. int retries = 0;
  7. Har har = null;
  8. while (retries < 30) {
  9. sleep(100);
  10. retries++;
  11. har = getHar();
  12. List<HarEntry> entries = har.getLog().getEntries();
  13. for (HarEntry entry : entries) {
  14. String url = entry.getRequest().getUrl();
  15. if (url.contentEquals(href)) {
  16. stopRecording();
  17. return entry;
  18. }
  19. }
  20. }
  21. writeHarFile(har, "missing-request");
  22. return null;
  23. }
Add Comment
Please, Sign In to add comment