Azure SPA - SharePoint Online - Images 400 Bad Request

Brass Contributor

Hi All,

I am facing an issue and hope I will get some directions to address this problem.

 

I have a single page app hosted in Azure and this app connects to SharePoint Online via AAD secured Web API. Everything seem to work except images which fails with 400 HTTP Error - The size of the request headers is too long. 

There is a section in SPA which shows list of images from SharePoint Online (attachment images from SP List item) via search REST. The images will be displayed without any issues if the user is already logged into SharePoint Online. But if user is not logged in, the images are failed to load and opening the image url in new browser tab shows the 400 error. Please let me know if I am missing anything or any direction will be helpful.

As a workaround, instead of bringing back the image URL from the Web API, I am now bringing back the byte[] and works nicely. But I am not too happy with this solution due to performance as well heavy payload response.

 

Thanks in advance.

1 Reply

Did you get a solution for this. We are also facing same issue


@Vishwanatha Nayak wrote:

Hi All,

I am facing an issue and hope I will get some directions to address this problem.

 

I have a single page app hosted in Azure and this app connects to SharePoint Online via AAD secured Web API. Everything seem to work except images which fails with 400 HTTP Error - The size of the request headers is too long. 

There is a section in SPA which shows list of images from SharePoint Online (attachment images from SP List item) via search REST. The images will be displayed without any issues if the user is already logged into SharePoint Online. But if user is not logged in, the images are failed to load and opening the image url in new browser tab shows the 400 error. Please let me know if I am missing anything or any direction will be helpful.

As a workaround, instead of bringing back the image URL from the Web API, I am now bringing back the byte[] and works nicely. But I am not too happy with this solution due to performance as well heavy payload response.

 

Thanks in advance.