Skip to content

Setting base url fail with error 400 #5081

Closed

Description

@Neurozone
ISSUE TYPE
  • Bug Report
SUMMARY

Whe have an internal dns with a domain like "org.les800"
when i'm trying to set the base url of the tower host with something like "tower.org.les800", it fail with an error 400 and url not valid

ENVIRONMENT
  • AWX version: 8.0.0
  • AWX install method: MrMee rpm
  • Ansible version: 2.8.6
  • Operating System: CentOS 7.7
  • Web Browser: Chrome latest
STEPS TO REPRODUCE

try an url like http://tower.org.les800 in settings/system

EXPECTED RESULTS

url for the base host set

ACTUAL RESULTS

got url with the name of the server instead

ADDITIONAL INFORMATION

Activity

  1. ryanpetrello commented on Oct 25, 2019

    @ryanpetrello
    Contributor

    @fosterseth you mind taking a look at this? I'll bet it's similar to the LDAP bug you recently fixed.

  2. self-assigned this
    on Oct 25, 2019
  3. fosterseth commented on Oct 25, 2019

    @fosterseth
    Member

    @ryanpetrello yes it's same issue as the LDAP bug.

    We can either make a new TowerURLBaseField class that subclasses URLField, and then feed in a custom regex pattern to the URLValidator to allow numbers in the top level domain. This is how it is done in the case of LDAPServerURIField.

    Or more generally we can change some logic in class URLField that adds an allow_number_in_top_level_domain flag and if set to True, will pass the modified regex into the validator. That way any setting of this class can be configured to have numbers in the TLD going forward.

  4. ryanpetrello commented on Oct 28, 2019

    @ryanpetrello
    Contributor

    Or more generally we can change some logic in class URLField that adds an allow_number_in_top_level_domain flag and if set to True, will pass the modified regex into the validator. That way any setting of this class can be configured to have numbers in the TLD going forward.

    I think this is probably a better idea going forward, and it probably makes sense to default allow_number_in_top_level_domain to True, given that numbers in TLDs is totally a thing.

  5. kdelee commented on Jan 13, 2020

    @kdelee
    Member

    connecting ldap stuff:
    issue: #3646
    PR: #4784

  6. self-assigned this
    on Jan 21, 2020
  7. added a commit that references this issue on Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions