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

400 error from server due to an invalid IP when using on localhost #81

Open
epos opened this issue Feb 5, 2021 · 0 comments
Open

400 error from server due to an invalid IP when using on localhost #81

epos opened this issue Feb 5, 2021 · 0 comments

Comments

@epos
Copy link

epos commented Feb 5, 2021

Hi,

Thank your for the project.

On an ASP.NET 4.5.2 MVC project running in IIS Express on my local machine, I get a 400 error from the Matomo 4.1.0 server :

https://piwik.<our domain>.com/piwik.php?idsite=11&rec=1&apiv=1&r=250779&cip=::1&_idts=1611940818&_id=7b2be05759a2bc7d&url=http%3a%2f%2flocalhost%2fdefault.aspx&e_c=mycat3&e_a=myact3

The 400 error is due to the cip=::1 query string value. When I remove cip from the query string, all goes well. It looks like the server rejects what it considers as an invalid IP value.

The problem likely lies in the PiwikTracker constructor :

            _ip = HttpContext.Current?.Request?.UserHostAddress ?? string.Empty;

Indeed, UserHostAddress returns ::1 on my machine, using IIS Express with .NET 4.5.2.

Best regards.

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

1 participant