Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-6063

Change HTTP status code when rejecting empty/generic user agents

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Admin
    • None

      Right now, we are apparently returning a 400 if a user uses an empty or generic user agent.
      According to https://tools.ietf.org/html/rfc2616 , 400 is "The request could not be understood by the server due to malformed syntax." whereas 403 is "The server understood the request, but is refusing to fulfill it.". We understood the request but are refusing to fulfil it because we don't like the user agent string, so 403 seems more appropriate to me.

      Either way, http://wiki.musicbrainz.org/XML_Web_Service/Rate_Limiting should also be updated. Right now it only mentions that users will receive a 503.

          [MBS-6063] Change HTTP status code when rejecting empty/generic user agents

          Ian McEwen added a comment -

          This is not handled by the ratelimiter, as the ratelimiter only returns an internally-formatted response; musicbrainz-server is responsible for setting the HTTP codes.

          Also, musicbrainz-server is always setting HTTP_SERVICE_UNAVAILABLE in response to ratelimiter calls. So presumably something else is breaking this.

          Ian McEwen added a comment - This is not handled by the ratelimiter, as the ratelimiter only returns an internally-formatted response; musicbrainz-server is responsible for setting the HTTP codes. Also, musicbrainz-server is always setting HTTP_SERVICE_UNAVAILABLE in response to ratelimiter calls. So presumably something else is breaking this.

          Just a note, but this isn't really a musicbrainz-server bug because this comes from the rate limiter.

          Oliver Charles added a comment - Just a note, but this isn't really a musicbrainz-server bug because this comes from the rate limiter.

            Unassigned Unassigned
            nikki nikki
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:

                Version Package