Setting HTTP Referrer on Maps API Browser Key Results in 403 Error

后端 未结 2 1723
执笔经年
执笔经年 2021-02-13 00:58

I\'m confused about how the HTTP Referrer settings work on Google Maps API Browser Keys.

I\'m building a webpage that programatically requests images from Google Maps (p

相关标签:
2条回答
  • 2021-02-13 01:29

    According to the HTTP referrer placeholder in the console, the *.example.com/* should indeed work.

    In practice, though, this indeed doesn't seem to be the case!

    I was able to solve the issue by simply setting the referrer to:

    example.com

    For more information, have a look at Registering authorized URLs. Good luck!

    0 讨论(0)
  • 2021-02-13 01:40

    If you use *.example.com/* you would have to come from either www.example.com or another subdomain, but this won't work if you are coming from example.com (notice the period in the first part of the URL)

    If you have some sort of redirect to example.com that strips out the first part of the URL, the best regex to use in this case is simply *example.com/* that would cover all subdomains behind example.com, http or https and all contexts after your domain.

    Hope it helps.

    0 讨论(0)
提交回复
热议问题