Git Product home page Git Product logo

Comments (8)

paulcwarren avatar paulcwarren commented on May 17, 2024

@estebes is there anymore stack trace than that? What Spring Content Module(s) are you using? Spring Content for JPA? And are you also using Spring Content REST?

A small project that reproduces this issue would be very helpful as well.

You could also cross reference your project against the relevant example in github.com/paulcwarren/spring-content-examples

from spring-content.

estebes avatar estebes commented on May 17, 2024

Full log - https://pastebin.com/1rtRt1QR

Dependencies
// Spring Content >> /* https://mvnrepository.com/artifact/com.github.paulcwarren/spring-content-fs-boot-starter */ compile group: 'com.github.paulcwarren', name: 'spring-content-fs-boot-starter', version: '0.0.7-SNAPSHOT' /* https://mvnrepository.com/artifact/com.github.paulcwarren/spring-content-rest-boot-starter */ compile group: 'com.github.paulcwarren', name: 'spring-content-rest-boot-starter', version: '0.0.7-SNAPSHOT' // << Spring Content

Html code
<a href="file.pdf" download>download here</a>
This also happens when i open the content in a new tab and click save as.

I'll try to create a small project reproducing the issue.

from spring-content.

paulcwarren avatar paulcwarren commented on May 17, 2024

A project may not be necessary @estebes.

I have a theory. When you click that 'download' I think your browser might not be sending an Accept header in the request. In ContentEntityRestController (

) we call a spring class to parse the mime-types received in the request's accept header. If there aren't any it returns an immmutable list that we then try and add to. This throws the UnsupportedOperationException.

So I wonder what browser you are using and whether you could check the request it is sending.

Look forward to hearing from you.

from spring-content.

paulcwarren avatar paulcwarren commented on May 17, 2024

Yeah, I think that is what is going on. I just managed to reproduce that error in a unit tests anyways. Your context will be helpful but i am going to go ahead and fix this as it is a bug anyways.

from spring-content.

estebes avatar estebes commented on May 17, 2024

So i just tried to use firefox instead of chrome and it actually works on firefox althoughit ignores the .pdf extension and downloads a .txt but yes what you described seems to be what is happening.

from spring-content.

paulcwarren avatar paulcwarren commented on May 17, 2024

I added a candidate fix for this issue in this commit:-

294fa48

Can you switchover to 0.0.8-SNAPSHOT and give it a whirl. If it fixes the issue then I'll cut a release.

from spring-content.

estebes avatar estebes commented on May 17, 2024

Perfect fix. Works on both chrome and firefox. I think i can now close this issue. Thank you very much for the help.

from spring-content.

paulcwarren avatar paulcwarren commented on May 17, 2024

+1

from spring-content.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.