Skip to content

Commit

Permalink
Update javadoc for UnpolyResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed May 7, 2024
1 parent 53af9f1 commit d5e27e3
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,26 @@ class UnpolyResponse {
setHeaderValue(UP_EXPIRE_CACHE, expireCache)
}

/**
* The server may set this response header to set a custom browser location after a fragment update.
* Without an X-Up-Location header Unpoly will set the browser location to the requested URL.
*/
void setLocation(String location) {
setHeaderValue(UP_LOCATION, location)
}

/**
* This request header contains the target selector for a successful fragment update.
*/
void setTarget(String target) {
setHeaderValue(UP_TARGET, target)
}

/**
* Set header value for response
* @param The name of header
* @return value
*/
void setHeaderValue(String name, Object value) {
this.response.setHeader(name, (value == null) ? "" : value.toString())
}
Expand Down

0 comments on commit d5e27e3

Please sign in to comment.