Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

use redirect hostname to lookup realm for correct mobile app #782

Merged
merged 3 commits into from
Oct 8, 2020

Conversation

mikehelmick
Copy link
Contributor

Fixes #779

Proposed Changes

  • use hostname when deciding what mobile app config to serve on .well-known
  • if no configuration, serve a 404
  • make cache TTL configurable

Release Note

BUGFIX: Ensure that .well-known is served for the correct region.

@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Oct 8, 2020
pkg/database/realm.go Show resolved Hide resolved
pkg/database/mobile_app.go Show resolved Hide resolved
Copy link
Member

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits, but can be a follow up

func (c *Controller) getAndroidData(region string) ([]AndroidData, error) {
realm, err := c.db.FindRealmByRegion(region)
if err != nil {
return nil, fmt.Errorf("unable to lookup realm")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("unable to lookup realm")
return nil, fmt.Errorf("unable to lookup realm: %w", err)

func (c *Controller) getIosData(region string) (*IOSData, error) {
realm, err := c.db.FindRealmByRegion(region)
if err != nil {
return nil, fmt.Errorf("unable to lookup realm")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("unable to lookup realm")
return nil, fmt.Errorf("unable to lookup realm: %w", err)

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikehelmick, sethvargo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mikehelmick,sethvargo]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 44303f9 into google:main Oct 8, 2020
@mikehelmick mikehelmick deleted the issue779 branch October 8, 2020 03:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2020
flagxor pushed a commit that referenced this pull request Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enx-redreict
3 participants