solal / stackoverflow-instant-answers

Top Stackoverflow answers, right from the Google search results
GNU General Public License v3.0
3 stars 0 forks source link

Requests with special characters fail #1

Open dalmo3 opened 4 years ago

dalmo3 commented 4 years ago

Hi there, just installed the extension on Brave/Win10 but the buttons don't work.

When google loads this error shows up in the console.

Failed to load resource: the server responded with a status of 400 (Bad Request) 

// and this is the bad request:
https://api.stackexchange.com/2.2/questions/60251889;tagged;tagged;tagged;tagged;tagged;tagged;6884313;tagged;tagged/answers?order=desc&sort=activity&site=stackoverflow&filter=!b6Aub*uCt1FjWD

Clicking a button throws another error:

base.js:151 Uncaught TypeError: Cannot read property 'body' of undefined
    at addAnswerContent (base.js:151)
    at HTMLButtonElement.<anonymous> (base.js:111)
    at HTMLButtonElement.dispatch (jquery-2.2.4.min.js:3)
    at HTMLButtonElement.r.handle (jquery-2.2.4.min.js:3)
solal commented 4 years ago

Hey! Thanks for installing 😃 I have to admit I haven't tested on Brave. It looks like the query to the Stackexchange API isn't properly formatted. Let me try and get back to you - hopefully with a fix!

solal commented 4 years ago

Hey man, I haven't been able to reproduce the issue. It works fine for me with both Brave and Chrome. Could you send me the search query you were typing when you had the issue? If you don't want to share it here, feel free to email me instead ✉️ s.catchfire@gmail.com

Thanks again for opening the the issue!

dalmo3 commented 4 years ago

Seems like any query with special chars fail.

This is the api response:

{"error_id":404,"error_message":"no method found with this name","error_name":"no_method"}
solal commented 4 years ago

Thanks for checking on that, I had a feeling this might be the issue. Will work on a fix this week.

Other than this, are you finding the extension useful?

solal commented 4 years ago

Note to self

Original title of the issue:

Failed to load resource: the server responded with a status of 400 (Bad Request) 
dalmo3 commented 4 years ago

Left some feedback in https://github.com/solal/stackoverflow-instant-answers/issues/2