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

Inbox URL not following configuration / losing trailing slash #183

Open
Terrance opened this issue Jan 29, 2023 · 0 comments
Open

Inbox URL not following configuration / losing trailing slash #183

Terrance opened this issue Jan 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Terrance
Copy link

I'm trying to use BirdsiteLive alongside Takahe, but I'm finding that posts are being sent to /inbox instead of /inbox/ and are therefore being rejected by the server.1

In the database I can see the correct URL:

birdsitelive=> select * from followers;
-[ RECORD 1 ]--------+--------------------------------------------------
id                   | 12
followings           | {1}
followingssyncstatus | {"1": -1}
acct                 | <user>
host                 | <domain>
inboxroute           | /inbox/
sharedinboxroute     | /inbox/
actorid              | https://<domain>/@<user>@<domain>/
postingerrorcount    | 0

But in the logs at follow time:

info: System.Net.Http.HttpClient.Default.LogicalHandler[100]
      Start processing HTTP request GET https://<domain>/@<user>@<domain>/
info: System.Net.Http.HttpClient.Default.ClientHandler[100]
      Sending HTTP request GET https://<domain>/@<user>@<domain>/
info: System.Net.Http.HttpClient.Default.ClientHandler[101]
      Received HTTP response headers after 8.4817ms - 200
info: System.Net.Http.HttpClient.Default.LogicalHandler[101]
      End processing HTTP request after 8.6428ms - 200
info: System.Net.Http.HttpClient.Default.LogicalHandler[100]
      Start processing HTTP request POST https://<domain>/inbox
info: System.Net.Http.HttpClient.Default.ClientHandler[100]
      Sending HTTP request POST https://<domain>/inbox
info: System.Net.Http.HttpClient.Default.ClientHandler[101]
      Received HTTP response headers after 47.6333ms - 500
info: System.Net.Http.HttpClient.Default.LogicalHandler[101]
      End processing HTTP request after 47.7498ms - 500
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at BirdsiteLive.Domain.ActivityPubService.PostDataAsync[T](T data, String targetHost, String actorUrl, String inbox) in /home/user/pkgbuild/birdsitelive/src/birdsitelive/src/BirdsiteLive.Domain/ActivityPubService.cs:line 173
   at BirdsiteLive.Domain.UserService.SendAcceptFollowAsync(ActivityFollow activity, String followerHost) in /home/user/pkgbuild/birdsitelive/src/birdsitelive/src/BirdsiteLive.Domain/UserService.cs:line 210
   at BirdsiteLive.Domain.UserService.FollowRequestedAsync(String signature, String method, String path, String queryString, Dictionary`2 requestHeaders, ActivityFollow activity, String body) in /home/user/pkgbuild/birdsitelive/src/birdsitelive/src/BirdsiteLive.Domain/UserService.cs:line 186
   at BirdsiteLive.Controllers.UsersController.Inbox() in /home/user/pkgbuild/birdsitelive/src/birdsitelive/src/BirdsiteLive/Controllers/UsersController.cs:line 202
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Note that it's POSTing to /inbox despite what's in the follower database record.

Footnotes

  1. This is a Python/Django app which enforces trailing slashes: RuntimeError: You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data.

@NicolasConstant NicolasConstant added the bug Something isn't working label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants