shubhamgoyal

Untitled

Mar 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (!hostInPathMode) {
  2.   urlRequested = changeURLRequested(urlRequested, getOriginalServerGivenHeaders(request['headers']))
  3. } else {
  4.   DEBUG&&console.log('urlRequested before is ');
  5.   DEBUG&&console.log(urlRequested);
  6.   urlRequested = getOriginalURLFromPath(urlRequested);
  7.   DEBUG&&console.log('urlRequested after is ');
  8.   DEBUG&&console.log(urlRequested);
  9. }
  10. if (lambdaHandlesImageURL(urlRequested)) {
  11.   if (request['headers'].signaturepresent && request['headers'].signatureseparator && request['headers'].signature) {
  12.     urlRequested = urlRequested + request['headers'].signatureseparator + request['headers'].signature;
  13.     DEBUG&&console.log('urlRequested is ', urlRequested);
  14.   }
  15. }
  16. if (giveLossyWebpForDesktop(urlRequested)) {
  17.   DEBUG&&console.log('changing device size to s')
  18.   deviceSize = 's';
  19. }
  20. const browser = getBrowserKeyFromAcceptHeader(request.headers['accept'])
  21. const device = getParsedDeviceForDynDB(deviceSize)
  22. const partitionKey = getDeviceBrowserKey(device, browser)
  23. updateTTLForItem(partitionKey, urlRequested)
Add Comment
Please, Sign In to add comment