botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Image URL with redirect is considered invalid

Open juhamust opened this issue 9 years ago • 4 comments

Attachment URL like http://lorempixel.com/400/200/sports is not shown in MS Teams or Skype:

# Log entry in https://dev.botframework.com/
Attached content from http://lorempixel.com/400/200/sports is invalid

This is because the actual URL is http://lorempixel.com/400/200/sports/ (service does return headers correctly).

NOTE: Bot Framework Emulator does show both URLs correctly (so not quite sure if the issue is in Skype and Teams instead of BotBuilder?)

juhamust avatar Mar 15 '17 14:03 juhamust

Are you attaching to your outbound message with the paperclip icon?

RichMoeMSFT avatar Mar 15 '17 21:03 RichMoeMSFT

I'm not quite sure what you're after @RichMoeMSFT but this is how I'm building the message:

const msg = new builder.Message(session)
  .text('Hello world!')
  .attachments([
    { contentType: 'image/jpeg', contentUrl: 'http://lorempixel.com/400/200/sports/' },
  ]);

bot.send(msg, (err) => {
  session.endDialog();
});

juhamust avatar Mar 16 '17 08:03 juhamust

Just noticed: Redirection works and image is shown when used within card:

new builder.HeroCard(session)
  .title('Image of the day')
  .subtitle('Provided to you by Lorempixel')
  .images([
    builder.CardImage.create(session, 'http://lorempixel.com/400/200/sports'),
  ])

juhamust avatar Mar 17 '17 08:03 juhamust

It does sound like this is an issue with the channels rather than Bot Framework. Glad you found a solution.

mgbennet avatar Mar 17 '17 16:03 mgbennet