Rest - JSON API - hostName vs headers.host

fdrozdowski

Posted on
Jun 09 2015

I have noticed that there are two separate fields for a host name. One is in details.request.hostName and another is in details.request.headers.host. Raygun, while filtering by host, uses the latter. Is there any reason why there are two separate fields?


Jamie Penney

Posted on
Jun 11 2015

Hey Filip,

Looks like we extract one or the other for indexing - favoring request.headers.hostName. Git history isn't giving me a good reason so I'm going to assume we get different values from some of the providers.

The front end normalizes the property names, which is why you would be seeing hostName there.

I'm going to update the API docs soon with a full set of properties we accept, with their preferred names.

Cheers, Jamie


fdrozdowski

Posted on
Jun 19 2015

Hi Jamie,

I did a couple of tests to verify it and here are the results:

Host filter works only if I submit request.headers.host and request.headers.user-Agent (regardless of the value in the latter field). Is there any reason why request.headers.user-Agent is required for the error to be correctly indexed?

It turns out that request.hostName does not matter at all. It is displayed (if present) in the error report but it does not get indexed while filtering by host.

Host filter doesn't work in the following situations:

  • when you submit only request.hostName and not request.headers.host,
  • when you submit request.headers.host but not request.headers.user-Agent.

I think it would be very helpful if you made it clear in your REST API documentation.


Reply