Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨[RUM-2158] Allow more flexible proxy URL #2502

Merged
merged 2 commits into from
Nov 17, 2023
Merged

✨[RUM-2158] Allow more flexible proxy URL #2502

merged 2 commits into from
Nov 17, 2023

Conversation

bcaudan
Copy link
Contributor

@bcaudan bcaudan commented Nov 14, 2023

Motivation

As discussed in #2429 and #2471, the current proxy strategy with the ddforward parameter, storing the target path and parameters, can be challenging to implement.

A solution allowing to have the path and parameters appended to the provided proxy URL was initially discarded since one of our URL pattern was already blocked, cf easylist.
However, some customers may want to use a proxy regardless of the privacy blocking or could want to tweak themselves the final proxy url to prevent the blocking.

Changes

Allow to pass a function to the proxy init parameter:

init({
  ...
  proxy: (options: {path: string, parameters: string}) => 
    `https://proxy.io/prefix${options.path}/suffix?${options.parameters}`
})

With:

  • path: /api/vX/product
  • parameters: xxx=yyy&zzz=aaa

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@bcaudan bcaudan marked this pull request as ready for review November 14, 2023 15:53
@bcaudan bcaudan requested a review from a team as a code owner November 14, 2023 15:53
@bcaudan bcaudan changed the title ✨Allow more flexible proxy URL ✨[RUM-2158] Allow more flexible proxy URL Nov 14, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b68f949) 93.24% compared to head (a2bce47) 93.24%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2502   +/-   ##
=======================================
  Coverage   93.24%   93.24%           
=======================================
  Files         222      222           
  Lines        6660     6662    +2     
  Branches     1466     1467    +1     
=======================================
+ Hits         6210     6212    +2     
  Misses        450      450           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bcaudan bcaudan merged commit 4d7e114 into main Nov 17, 2023
2 checks passed
@bcaudan bcaudan deleted the bcaudan/proxy-fn branch November 17, 2023 09:00
@hermanbanken
Copy link

Thanks @bcaudan!

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.

4 participants