Skip to content

Conversation

@fawazahmed0
Copy link

@fawazahmed0 fawazahmed0 commented May 8, 2020

-Fix APIURL with query string getting stripped
@fawazahmed0
Copy link
Author

fawazahmed0 commented May 8, 2020

apiurl such as https://duckduckgo.com/?q=tro was getting stripped to https://duckduckgo.com/
Now it seems to work fine.

Just a question, I am not sure why the template doesn't work with google urls such as https://www.google.com/search?&q=marine
All other sites url (except google) works fine though, not sure if this has something to do with template
Update: using var instead of let for response variable , seems to solve the problem, and I don't think it has something to do with template
Update2: var or let doesn't make any difference, it has to do with how the server responds, so no problem with the template

@fawazahmed0 fawazahmed0 changed the title Use unescapse instead of searchParams Use Unescapse instead of searchParams May 8, 2020
@fawazahmed0 fawazahmed0 changed the title Use Unescapse instead of searchParams Use Unescape instead of searchParams May 8, 2020
@fawazahmed0 fawazahmed0 changed the title Use Unescape instead of searchParams Use unescape instead of searchParams May 8, 2020
@fawazahmed0
Copy link
Author

fawazahmed0 commented May 8, 2020

Also it would be better to change line 13 to generalize the template
Something like:
// Setting CORS headers, we are allowing all the sites, you will have to limit this to specific sites in production
response.headers.set('Access-Control-Allow-Origin', '*')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant