Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
We Distribute
  1. Home
  2. General Discussion
  3. Does the #Bluesky bridge thing use some kind of odd `content-type` when requesting profile data?

Does the #Bluesky bridge thing use some kind of odd `content-type` when requesting profile data?

Scheduled Pinned Locked Moved General Discussion
blueskyactivitypub
12 Posts 5 Posters 12 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jdt@enigmatick.socialJ jdt@enigmatick.social

    Does the #Bluesky bridge thing use some kind of odd content-type when requesting profile data? I'm seeing these errors in my logs when my server tries to retrieve posts (as part of my reply retrieval functions):

    [2025-12-09T00:59:33Z ERROR enigmatick::retriever] Failed to fetch object from remote. URL: https://bsky.brid.gy/convert/ap/at://did:plc:oofa3qqoiszsmajbigfqskqv/app.bsky.feed.post/3m7egmddbwk2h, Status: 502 Bad Gateway, Body: <!doctype html>
        <html lang=en>
        <title>502 Bad Gateway</title>
        <h1>Bad Gateway</h1>
        <p>Couldn't fetch https://enigmatick.social/user/jdt as ActivityStreams 2: Couldn't decode as JSON</p>
    

    If I'm reading that right, my retriever is failing because the bridge is trying to retrieve my profile and can't convert it to JSON. But I verified that my profile is provided as JSON for requests with these Accept header types:

    • application/json
    • application/activity+json
    • application/ld+json
    • application/ld+json; profile="https://www.w3.org/ns/activitystreams

    ...so I can't figure out what it's complaining about. I'll need to watch my varnish logs to see if I can capture one of the requests live from that perspective.

    #ActivityPub

    liaizon@social.wake.stL This user is from outside of this forum
    liaizon@social.wake.stL This user is from outside of this forum
    liaizon@social.wake.st
    wrote on last edited by
    #2

    @jdt this seems like it could use a @snarfed.org tag 🙂

    julian@activitypub.spaceJ 1 Reply Last reply
    0
    • liaizon@social.wake.stL liaizon@social.wake.st

      @jdt this seems like it could use a @snarfed.org tag 🙂

      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.space
      wrote on last edited by julian@activitypub.space
      #3

      liaizon@social.wake.st I pinged him, he says he can't respond yet because of the aforementioned connection negotiation issue! 🙂

      jdt@enigmatick.social

      1 Reply Last reply
      0
      • jdt@enigmatick.socialJ jdt@enigmatick.social

        Does the #Bluesky bridge thing use some kind of odd content-type when requesting profile data? I'm seeing these errors in my logs when my server tries to retrieve posts (as part of my reply retrieval functions):

        [2025-12-09T00:59:33Z ERROR enigmatick::retriever] Failed to fetch object from remote. URL: https://bsky.brid.gy/convert/ap/at://did:plc:oofa3qqoiszsmajbigfqskqv/app.bsky.feed.post/3m7egmddbwk2h, Status: 502 Bad Gateway, Body: <!doctype html>
            <html lang=en>
            <title>502 Bad Gateway</title>
            <h1>Bad Gateway</h1>
            <p>Couldn't fetch https://enigmatick.social/user/jdt as ActivityStreams 2: Couldn't decode as JSON</p>
        

        If I'm reading that right, my retriever is failing because the bridge is trying to retrieve my profile and can't convert it to JSON. But I verified that my profile is provided as JSON for requests with these Accept header types:

        • application/json
        • application/activity+json
        • application/ld+json
        • application/ld+json; profile="https://www.w3.org/ns/activitystreams

        ...so I can't figure out what it's complaining about. I'll need to watch my varnish logs to see if I can capture one of the requests live from that perspective.

        #ActivityPub

        snarfed@activitypub.spaceS This user is from outside of this forum
        snarfed@activitypub.spaceS This user is from outside of this forum
        snarfed@activitypub.space
        wrote on last edited by
        #4

        Hey jdt@enigmatick.social, sorry for the trouble! We send Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams", text/html; charset=utf-8; q=0.5 with our AP fetches, which seems to make enigmatick.social 303 redirect to the HTML profile page, eg /@jdt here.

        (Sorry for the complicated Accept header! We get URLs from various places, so if a URL isn't an AP id, we want to fall back to handling it as HTML and find its AP object via a rel-alternate link.)

        1 Reply Last reply
        0
        • jdt@enigmatick.socialJ This user is from outside of this forum
          jdt@enigmatick.socialJ This user is from outside of this forum
          jdt@enigmatick.social
          wrote on last edited by
          #5

          @julian@activitypub.space My guess is that his JSON processor is choking on a non-standard tag I have in my profile (e.g., keys or ephemeral.webfinger). I should clean up the latter since it's intended for client operations only.

          But it is valid JSON either way. The ephemeral object might cause a JSON-LD parser to choke since I don't declare it in the @context.

          informapirata@activitypub.spaceI 1 Reply Last reply
          0
          • jdt@enigmatick.socialJ jdt@enigmatick.social

            @julian@activitypub.space My guess is that his JSON processor is choking on a non-standard tag I have in my profile (e.g., keys or ephemeral.webfinger). I should clean up the latter since it's intended for client operations only.

            But it is valid JSON either way. The ephemeral object might cause a JSON-LD parser to choke since I don't declare it in the @context.

            informapirata@activitypub.spaceI This user is from outside of this forum
            informapirata@activitypub.spaceI This user is from outside of this forum
            informapirata@activitypub.space
            wrote on last edited by
            #6

            jdt@enigmatick.social I'm sure julian will be able to solve this compatibility issue between NodeBB and Fedibridge together with snarfed@mas.to and when he does, it will be a great day for the Fediverse! 😊

            1 Reply Last reply
            0
            • jdt@enigmatick.socialJ This user is from outside of this forum
              jdt@enigmatick.socialJ This user is from outside of this forum
              jdt@enigmatick.social
              wrote on last edited by
              #7

              @julian@activitypub.space I think I see the issue on @snarfed's post on your site (thanks @snarfed). I don't currently handle application/activity+json requests for the URL (i.e., https://enigmatick.social/@jdt). I only handle those on the ID (i.e., https://enigmatick.social/user/jdt).

              I don't see any harm in adding that to the URL, so I'll add a 301 to redirect application/activity+json requests for /@jdt to /user/jdt.

              It's odd, though - my logs seem to indicate that the bridge server is requesting /user/jdt already.

              1 Reply Last reply
              0
              • jdt@enigmatick.socialJ This user is from outside of this forum
                jdt@enigmatick.socialJ This user is from outside of this forum
                jdt@enigmatick.social
                wrote on last edited by
                #8

                @julian@activitypub.space I see the issue clearly now and can reproduce it (thanks @snarfed). It's just the complexity of the Accept header - I'll dig into why my nginx configuration isn't handling that well.

                jdt@enigmatick.socialJ 1 Reply Last reply
                0
                • jdt@enigmatick.socialJ jdt@enigmatick.social

                  @julian@activitypub.space I see the issue clearly now and can reproduce it (thanks @snarfed). It's just the complexity of the Accept header - I'll dig into why my nginx configuration isn't handling that well.

                  jdt@enigmatick.socialJ This user is from outside of this forum
                  jdt@enigmatick.socialJ This user is from outside of this forum
                  jdt@enigmatick.social
                  wrote on last edited by
                  #9

                  @jdt@enigmatick.social It's actually in my application code:

                  if let Some(accept) = headers.get(header::ACCEPT) {
                      if let Ok(accept_str) = accept.to_str() {
                          if accept_str.contains("text/html") {
                              log::debug!("Redirecting to presentation page");
                              return Ok(AbstractResponse::Redirect(Redirect::to(&format!(
                                  "/@{username}"
                              ))));
                          }
                          if accept_str.contains("application/activity+json") {
                              log::debug!("Returning application/activity+json");
                              return Ok(AbstractResponse::ActivityJson(ActivityJson(actor)));
                          }
                          if accept_str.contains("application/ld+json") {
                              log::debug!("Returning application/ld+json");
                              return Ok(AbstractResponse::LdJson(LdJson(actor)));
                          }
                      }
                  }
                  

                  Just a priority issue with the existence of text/html. I'll rearrange.

                  jdt@enigmatick.socialJ 1 Reply Last reply
                  0
                  • jdt@enigmatick.socialJ jdt@enigmatick.social

                    @jdt@enigmatick.social It's actually in my application code:

                    if let Some(accept) = headers.get(header::ACCEPT) {
                        if let Ok(accept_str) = accept.to_str() {
                            if accept_str.contains("text/html") {
                                log::debug!("Redirecting to presentation page");
                                return Ok(AbstractResponse::Redirect(Redirect::to(&format!(
                                    "/@{username}"
                                ))));
                            }
                            if accept_str.contains("application/activity+json") {
                                log::debug!("Returning application/activity+json");
                                return Ok(AbstractResponse::ActivityJson(ActivityJson(actor)));
                            }
                            if accept_str.contains("application/ld+json") {
                                log::debug!("Returning application/ld+json");
                                return Ok(AbstractResponse::LdJson(LdJson(actor)));
                            }
                        }
                    }
                    

                    Just a priority issue with the existence of text/html. I'll rearrange.

                    jdt@enigmatick.socialJ This user is from outside of this forum
                    jdt@enigmatick.socialJ This user is from outside of this forum
                    jdt@enigmatick.social
                    wrote on last edited by
                    #10

                    @jdt@enigmatick.social Fixed. My code handles the Accept header per RFC specifications now (i.e., by explicit weight first and by order second).

                    1 Reply Last reply
                    1
                    • jdt@enigmatick.socialJ This user is from outside of this forum
                      jdt@enigmatick.socialJ This user is from outside of this forum
                      jdt@enigmatick.social
                      wrote on last edited by
                      #11

                      @julian@activitypub.space BTW, I love that your interface uses rich formatting for markdown code blocks - so many platforms just phone that bit in.

                      Enigmatick uses highlight.js too, so I tend to use that a lot.

                      julian@activitypub.spaceJ 1 Reply Last reply
                      0
                      • jdt@enigmatick.socialJ jdt@enigmatick.social

                        @julian@activitypub.space BTW, I love that your interface uses rich formatting for markdown code blocks - so many platforms just phone that bit in.

                        Enigmatick uses highlight.js too, so I tend to use that a lot.

                        julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.space
                        wrote on last edited by
                        #12

                        jdt@enigmatick.social thanks! Yeah it was important to me to get that right. That little highlight library has been chugging along all this time lol.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        Powered by NodeBB Contributors
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups