awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
921 stars 266 forks source link

Question: When the new CloudFront headers will be available for the AppSync resolvers? #584

Open ignaciolarranaga opened 4 years ago

ignaciolarranaga commented 4 years ago

Hi, some weeks ago a new set of geolocation headers were added to CloudFront (see https://aws.amazon.com/about-aws/whats-new/2020/07/cloudfront-geolocation-headers/).

Is there some ETA on when does the new headers will being available in the servers?, because currently they are still not available.

Do you want to request a feature or report a bug? Question / Feature Request

What is the current behavior? Only the previous set of headers is being sent, example:

headers: {
      'x-forwarded-for': '179.24.30.121, 130.176.27.160',
      'cloudfront-viewer-country': 'UY',
      'cloudfront-is-tablet-viewer': 'false',
      via: '2.0 .....4d81475b952240b1e00ec.cloudfront.net (CloudFront)',
      'cloudfront-forwarded-proto': 'https',
      origin: 'https://...71sr6k.cloudfront.net',
      'content-length': '403',
      'accept-language': 'es',
      host: '....xc4datmeyq.appsync-api.us-east-1.amazonaws.com',
      'x-forwarded-proto': 'https',
      'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36',
      accept: 'application/json, text/plain, */*',
      'cloudfront-is-mobile-viewer': 'false',
      'cloudfront-is-smarttv-viewer': 'false',
      'accept-encoding': 'gzip, deflate, br',
      referer: 'https://....71sr6k.cloudfront.net/....,
      'x-api-key': '....fkndgdevfzqd2snrujq',
      'content-type': 'application/json; charset=UTF-8',
      'sec-fetch-mode': 'cors',
      'x-amz-cf-id': ....6jR6TIpiPGGaQyoyuw==',
      'x-amzn-trace-id': 'Root=1-5f4aa86d-5d1ed20....',
      'sec-fetch-dest': 'empty',
      'x-amz-user-agent': 'aws-amplify/3.4.3 js',
      'cloudfront-is-desktop-viewer': 'true',
      'sec-fetch-site': 'cross-site',
      'x-forwarded-port': '443'
}

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Not a bug

What is the expected behavior? New headers being included in the AppSync request, example:

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? Amplify API -> AppSync

hisham commented 3 years ago

+1. This would be super useful.

aaronkoss commented 12 months ago

Our company would love this as well.