X Tutup
The Wayback Machine - https://web.archive.org/web/20211008091336/https://github.com/angular/angular/pull/37539
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

feat(platform-server): add option for absolute URL HTTP support #37539

Closed
wants to merge 1 commit into from

Conversation

@CaerusKaru
Copy link
Member

@CaerusKaru CaerusKaru commented Jun 11, 2020

In version 10.0.0-next.8, we introduced absolute URL support for
server-based HTTP requests, so long as the fully-resolved URL was
provided in the initial config. However, doing so represents a
breaking change for users who already have their own interceptors
to model this functionality, since our logic executes before all
interceptors fire on a request.

Therefore, we introduce a flag to make this change consistent with
v9 behavior, allowing users to opt in to this new behavior. This
commit also fixes two issues with the previous implementation:

  1. if the server was initiated with a relative URL, the absolute
    URL construction would fail because needed components were empty
  2. if the user's absolute URL was on a port, the port would not
    be included

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@CaerusKaru CaerusKaru force-pushed the adam/http branch 3 times, most recently from d0fcc97 to ba49241 Jun 11, 2020
Copy link
Contributor

@alan-agius4 alan-agius4 left a comment

LGTM

One small nit

@CaerusKaru CaerusKaru force-pushed the adam/http branch 4 times, most recently from 118416b to e650076 Jun 12, 2020
@kyliau
Copy link
Contributor

@kyliau kyliau commented Jun 12, 2020

Note: We've decided to rollback this feature in v10.0.
I've set the target to master-only for this to go out in v10.1

Copy link
Member

@IgorMinar IgorMinar left a comment

LGTM! Thanks!

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from jelbourn Jun 17, 2020
In version 10.0.0-next.8, we introduced absolute URL support for
server-based HTTP requests, so long as the fully-resolved URL was
provided in the initial config. However, doing so represents a
breaking change for users who already have their own interceptors
to model this functionality, since our logic executes before all
interceptors fire on a request. See original PR angular#37071.

Therefore, we introduce a flag to make this change consistent with
v9 behavior, allowing users to opt in to this new behavior. This
commit also fixes two issues with the previous implementation:
1. if the server was initiated with a relative URL, the absolute
URL construction would fail because needed components were empty
2. if the user's absolute URL was on a port, the port would not
be included
Copy link
Member

@jelbourn jelbourn left a comment

LGTM

Reviewed-for: public-api

Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

LGTM

Reviewed-for: public-api

@kyliau kyliau removed the request for review from alxhub Jun 24, 2020
@pullapprove pullapprove bot requested a review from alxhub Jun 24, 2020
@kyliau
Copy link
Contributor

@kyliau kyliau commented Jun 24, 2020

kyliau
kyliau approved these changes Jun 24, 2020
@kyliau kyliau removed the request for review from alxhub Jun 24, 2020
ngwattcos added a commit to ngwattcos/angular that referenced this issue Jun 25, 2020
…lar#37539)

In version 10.0.0-next.8, we introduced absolute URL support for
server-based HTTP requests, so long as the fully-resolved URL was
provided in the initial config. However, doing so represents a
breaking change for users who already have their own interceptors
to model this functionality, since our logic executes before all
interceptors fire on a request. See original PR angular#37071.

Therefore, we introduce a flag to make this change consistent with
v9 behavior, allowing users to opt in to this new behavior. This
commit also fixes two issues with the previous implementation:
1. if the server was initiated with a relative URL, the absolute
URL construction would fail because needed components were empty
2. if the user's absolute URL was on a port, the port would not
be included

PR Close angular#37539
@chamikasandamal
Copy link

@chamikasandamal chamikasandamal commented Jul 25, 2020

This is not working for me in 10.0.4. Is there any working example for this?

@CaerusKaru
Copy link
Member Author

@CaerusKaru CaerusKaru commented Jul 25, 2020

It's only a part 10.1. It was reverted out of 10.0.

@chamikasandamal
Copy link

@chamikasandamal chamikasandamal commented Jul 26, 2020

But in the documentation it says,

If you are using one of the @nguniversal/*-engine packages (such as @nguniversal/express-engine), this is taken care for you automatically. You don't need to do anything to make relative URLs work on the server.

So I have to keep using the universal interceptor until 10.1?

@CaerusKaru
Copy link
Member Author

@CaerusKaru CaerusKaru commented Jul 26, 2020

Yes

@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Aug 26, 2020

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 26, 2020
profanis added a commit to profanis/angular that referenced this issue Sep 5, 2020
…lar#37539)

In version 10.0.0-next.8, we introduced absolute URL support for
server-based HTTP requests, so long as the fully-resolved URL was
provided in the initial config. However, doing so represents a
breaking change for users who already have their own interceptors
to model this functionality, since our logic executes before all
interceptors fire on a request. See original PR angular#37071.

Therefore, we introduce a flag to make this change consistent with
v9 behavior, allowing users to opt in to this new behavior. This
commit also fixes two issues with the previous implementation:
1. if the server was initiated with a relative URL, the absolute
URL construction would fail because needed components were empty
2. if the user's absolute URL was on a port, the port would not
be included

PR Close angular#37539
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
X Tutup