Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces in hostnames #36

Open
eldiddio opened this issue Jun 20, 2013 · 3 comments
Open

Spaces in hostnames #36

eldiddio opened this issue Jun 20, 2013 · 3 comments

Comments

@eldiddio
Copy link

When I call the API like this:

/host/Test_Server_1 the API responds fine.

however if I try this:

/host/Test Server 1

The API responds with {"content": "Invalid request URI", "success": false}

Can you please advise how i can get details of hostnames with spaces in the name?

Thanks

@ghostsquad
Copy link
Contributor

I don't believe spaces are valid characters for hostnames. However, the URL encoding for "space" is %20. So, you may want to try /host/Test%20Server%201.

@ghostsquad
Copy link
Contributor

Now that I'm using this api myself, I understand the reason for this issue. The nagios object name for a host may not be the actual hostname of the server, and as such, spaces are permitted. Even with url encoding, it comes back is an invalid request.

MaxBear pushed a commit to MaxBear/nagios-api that referenced this issue Jan 29, 2015
zorkian added a commit that referenced this issue Jan 29, 2015
Fix issue #36 if request URL contains object id with space, api server will crash
@ghostsquad
Copy link
Contributor

@MaxBear - your commit won't work, because "spaces" aren't actually allow in a URL, a urlencoded name that includes spaces: before: test server would be test+server or test%20server. I've fixed that in ghostsquad/nagios-api@ef52c90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants